Clean up more evals that have local variables are not working correctly.

This commit is contained in:
Jeff Hutchinson 2021-09-12 15:05:19 -04:00
parent a30f64506f
commit 7556e403e7
6 changed files with 27 additions and 29 deletions

View file

@ -262,7 +262,7 @@ function NavEditorGui::findCover(%this)
%pos = LocalClientConnection.getControlObject().getPosition();
%text = NavEditorOptionsWindow-->TestProperties->CoverPosition.getText();
if(%text !$= "")
%pos = eval(%text);
%pos = eval("return " @ %text);
%this.getPlayer().findCover(%pos, NavEditorOptionsWindow-->TestProperties->CoverRadius.getText());
}
}
@ -275,7 +275,7 @@ function NavEditorGui::followObject(%this)
%text = NavEditorOptionsWindow-->TestProperties->FollowObject.getText();
if(%text !$= "")
{
eval("%obj = " @ %text);
%obj = eval("return " @ %text);
if(!isObject(%obj))
toolsMessageBoxOk("Error", "Cannot find object" SPC %text);
}