mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1357 from Azaezel/alpha41/subScenSplineShenanigans
spline objects were mis-saving in submis files
This commit is contained in:
commit
b105fce2f2
1 changed files with 5 additions and 49 deletions
|
|
@ -1433,29 +1433,7 @@ void PersistenceManager::updateObject(SimObject* object, ParsedObject* parentObj
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: This should be wrapped in a helper method... probably.
|
updateToken(prop.valueLine, prop.valuePosition, prop.endPosition - prop.valuePosition, value, true);
|
||||||
// Detect and collapse relative path information
|
|
||||||
if (f->type == TypeFilename ||
|
|
||||||
f->type == TypeStringFilename ||
|
|
||||||
f->type == TypeImageFilename ||
|
|
||||||
f->type == TypePrefabFilename ||
|
|
||||||
f->type == TypeShapeFilename ||
|
|
||||||
f->type == TypeSoundFilename)
|
|
||||||
{
|
|
||||||
char fnBuf[1024];
|
|
||||||
Con::collapseScriptFilename(fnBuf, 1024, value);
|
|
||||||
|
|
||||||
updateToken(prop.valueLine, prop.valuePosition, prop.endPosition - prop.valuePosition, fnBuf, true);
|
|
||||||
}
|
|
||||||
else if (f->type == TypeCommand || f->type == TypeString || f->type == TypeRealString)
|
|
||||||
{
|
|
||||||
char cmdBuf[1024];
|
|
||||||
expandEscape(cmdBuf, value);
|
|
||||||
|
|
||||||
updateToken(prop.valueLine, prop.valuePosition, prop.endPosition - prop.valuePosition, cmdBuf, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
updateToken(prop.valueLine, prop.valuePosition, prop.endPosition - prop.valuePosition, value, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1520,29 +1498,7 @@ void PersistenceManager::updateObject(SimObject* object, ParsedObject* parentObj
|
||||||
// value then add it to the ParsedObject's newLines
|
// value then add it to the ParsedObject's newLines
|
||||||
if (mustUpdate)
|
if (mustUpdate)
|
||||||
{
|
{
|
||||||
// TODO: This should be wrapped in a helper method... probably.
|
newLines.push_back(String::String(value).c_str());
|
||||||
// Detect and collapse relative path information
|
|
||||||
if (f->type == TypeFilename ||
|
|
||||||
f->type == TypeStringFilename ||
|
|
||||||
f->type == TypeImageFilename ||
|
|
||||||
f->type == TypePrefabFilename ||
|
|
||||||
f->type == TypeShapeFilename ||
|
|
||||||
f->type == TypeSoundFilename)
|
|
||||||
{
|
|
||||||
char fnBuf[1024];
|
|
||||||
Con::collapseScriptFilename(fnBuf, 1024, value);
|
|
||||||
|
|
||||||
newLines.push_back(createNewProperty(f->pFieldname, fnBuf, f->elementCount > 1, j));
|
|
||||||
}
|
|
||||||
else if (f->type == TypeCommand)
|
|
||||||
{
|
|
||||||
char cmdBuf[1024];
|
|
||||||
expandEscape(cmdBuf, value);
|
|
||||||
|
|
||||||
newLines.push_back(createNewProperty(f->pFieldname, cmdBuf, f->elementCount > 1, j));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
newLines.push_back(createNewProperty(f->pFieldname, value, f->elementCount > 1, j));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultValue)
|
if (defaultValue)
|
||||||
|
|
@ -1858,11 +1814,11 @@ void PersistenceManager::updateObject(SimObject* object, ParsedObject* parentObj
|
||||||
// Clean up the newLines memory
|
// Clean up the newLines memory
|
||||||
for (U32 i = 0; i < newLines.size(); i++)
|
for (U32 i = 0; i < newLines.size(); i++)
|
||||||
{
|
{
|
||||||
if (newLines[i])
|
if (!isEmptyLine(newLines[i]) && !StringTable->lookup(newLines[i]))
|
||||||
{
|
{//don't try killing empty lines or lines that are in the string table
|
||||||
dFree(newLines[i]);
|
dFree(newLines[i]);
|
||||||
newLines[ i ] = NULL;
|
|
||||||
}
|
}
|
||||||
|
newLines[ i ] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
newLines.clear();
|
newLines.clear();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue