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

@ -1486,7 +1486,7 @@ bool ActionMap::processAction(const InputEventInfo* pEvent)
{
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
Con::evaluate(pNode->makeConsoleCommand, false, context);
Con::evaluate(pNode->makeConsoleCommand, false, context.c_str());
}
}
else if (pNode->flags & Node::Held)