for context Strings, use c_str(),
for triggers, use Con::getCurrentScriptModulePath() as otherwise, the "%this =" and "%obj=" injections will be treated as within the global scope. which is not allowed.
This commit is contained in:
AzaezelX 2026-02-24 15:04:38 -06:00
parent 5981154102
commit 627b9bc076
4 changed files with 11 additions and 29 deletions

View file

@ -496,7 +496,7 @@ void GuiGameSettingsCtrl::doScriptCommand(StringTableEntry command)
setThisControl();
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
Con::evaluate(command, false, context);
Con::evaluate(command, false, context.c_str());
}
}