mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 12:30:31 +00:00
Merge pull request #685 from Ragora/bugfix-color-key-by-name
BugFix: Correct data corruption potential in GuiInspectorField
This commit is contained in:
commit
13cd3de2ad
2 changed files with 8 additions and 5 deletions
|
|
@ -314,11 +314,13 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
|
|||
|
||||
String newValue = strData;
|
||||
S32 type= mField->type;
|
||||
ConsoleValue evaluationResult;
|
||||
if( type == TypeS8 || type == TypeS32 || type == TypeF32 )
|
||||
{
|
||||
char buffer[ 2048 ];
|
||||
expandEscape( buffer, newValue );
|
||||
newValue = (const char*)Con::evaluatef( "$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer );
|
||||
evaluationResult = Con::evaluatef("$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer);
|
||||
newValue = evaluationResult.getString();
|
||||
Con::evaluatef("$f=0;");
|
||||
}
|
||||
else if( type == TypeS32Vector
|
||||
|
|
@ -354,13 +356,13 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
|
|||
char buffer[ 2048 ];
|
||||
expandEscape( buffer, newComponentExpr );
|
||||
|
||||
const char* newComponentVal = Con::evaluatef( "$f = \"%s\"; $v = \"%s\"; return ( %s );",
|
||||
oldComponentVal, oldValue.c_str(), buffer );
|
||||
evaluationResult = Con::evaluatef("$f = \"%s\"; $v = \"%s\"; return ( %s );",
|
||||
oldComponentVal, oldValue.c_str(), buffer);
|
||||
Con::evaluatef("$f=0;$v=0;");
|
||||
|
||||
if( !isFirst )
|
||||
strNew.append( ' ' );
|
||||
strNew.append( newComponentVal );
|
||||
strNew.append( evaluationResult.getString() );
|
||||
|
||||
isFirst = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,7 +454,8 @@ bool SFXDescription::onAdd()
|
|||
const char* channelValue = getDataField( sChannel, NULL );
|
||||
if( channelValue && channelValue[ 0 ] )
|
||||
{
|
||||
const char* group = Con::evaluatef( "return sfxOldChannelToGroup( %s );", channelValue );
|
||||
ConsoleValue result = Con::evaluatef( "return sfxOldChannelToGroup( %s );", channelValue );
|
||||
const char* group = result.getString();
|
||||
if( !Sim::findObject( group, mSourceGroup ) )
|
||||
Con::errorf( "SFXDescription::onAdd - could not resolve channel '%s' to SFXSource", channelValue );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue