Browse Source

Fixes the command build for the Navmesh's Follow test tool so it doesn't create a parse error

Areloch 2 years ago
parent
commit
5c52d565bc
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Templates/BaseGame/game/tools/navEditor/navEditor.tscript

+ 5 - 1
Templates/BaseGame/game/tools/navEditor/navEditor.tscript

@@ -275,7 +275,11 @@ function NavEditorGui::followObject(%this)
       %text = NavEditorOptionsWindow-->TestProperties->FollowObject.getText();
       if(%text !$= "")
       {
-         %obj = eval("return " @ %text);
+         %command = "return " @ %text;
+         if(!endsWith(%command, ";"))
+            %command = %command @ ";";
+            
+         %obj = eval(%command);
          if(!isObject(%obj))
             toolsMessageBoxOk("Error", "Cannot find object" SPC %text);
       }