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())