Merge pull request #665 from Azaezel/alpha40/TriggerSelfReferencing

fill out a %this variable for trigger callbacks
This commit is contained in:
Brian Roberts 2021-11-08 14:37:39 -06:00 committed by GitHub
commit 721f14a284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -731,7 +731,8 @@ void Trigger::potentialEnterObject(GameBase* enter)
if(evalCmD(&mEnterCommand)) 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()); Con::evaluate(command.c_str());
} }
@ -779,7 +780,8 @@ void Trigger::processTick(const Move* move)
if (evalCmD(&mLeaveCommand)) 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()); Con::evaluate(command.c_str());
} }
if (testTrippable() && testCondition()) if (testTrippable() && testCondition())