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

@ -213,7 +213,7 @@ bool GuiMLTextEditCtrl::onKeyDown(const GuiEvent& event)
{
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
String context = String::ToString("%s, Object: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
Con::evaluate( mEscapeCommand, false, context );
Con::evaluate( mEscapeCommand, false, context.c_str());
return( true );
}
return( Parent::onKeyDown( event ) );