Browse Source

* BugFix: Correct a scoping error with ConsoleValue in the updated code in GuiInspectorField.

Robert MacGregor 3 years ago
parent
commit
41e5988c46
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Engine/source/gui/editor/inspector/field.cpp

+ 5 - 4
Engine/source/gui/editor/inspector/field.cpp

@@ -314,12 +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 );
-            ConsoleValue result = Con::evaluatef("$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer);
-            newValue = result.getString();
+            evaluationResult = Con::evaluatef("$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer);
+            newValue = evaluationResult.getString();
             Con::evaluatef("$f=0;");
          }
          else if(    type == TypeS32Vector
@@ -355,13 +356,13 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
                char buffer[ 2048 ];
                expandEscape( buffer, newComponentExpr );
 
-               ConsoleValue result = Con::evaluatef("$f = \"%s\"; $v = \"%s\"; return ( %s );",
+               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( result.getString() );
+               strNew.append( evaluationResult.getString() );
                
                isFirst = false;
             }