From 733b71ccad97827a88b076a59728c4b13d7e923e Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 7 Nov 2021 14:52:25 -0600 Subject: [PATCH] fill out a %this variable for trigger callbacks --- Engine/source/T3D/trigger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/trigger.cpp b/Engine/source/T3D/trigger.cpp index e6b1d2027..1d075d7c3 100644 --- a/Engine/source/T3D/trigger.cpp +++ b/Engine/source/T3D/trigger.cpp @@ -731,7 +731,8 @@ void Trigger::potentialEnterObject(GameBase* enter) if(evalCmD(&mEnterCommand)) { - String command = String("%obj = ") + enter->getIdString() + ";" + mEnterCommand; + String command = String("%obj = ") + enter->getIdString() + ";"; + command = command + String("%this = ") + getIdString() + ";" + mEnterCommand; Con::evaluate(command.c_str()); } @@ -779,7 +780,8 @@ void Trigger::processTick(const Move* move) if (evalCmD(&mLeaveCommand)) { - String command = String("%obj = ") + remove->getIdString() + ";" + mLeaveCommand; + String command = String("%obj = ") + remove->getIdString() + ";"; + command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand; Con::evaluate(command.c_str()); } if (testTrippable() && testCondition())