mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Merge pull request #665 from Azaezel/alpha40/TriggerSelfReferencing
fill out a %this variable for trigger callbacks
This commit is contained in:
commit
721f14a284
1 changed files with 4 additions and 2 deletions
|
|
@ -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())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue