mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-01 19:43:49 +00:00
Caches the processed line in CodeBlock for better assert reporting
Adds additional context on eval and evaluate calls to better isolate script executions that are throwing errors, such as via command fields or eval() calls.
This commit is contained in:
parent
2dae0fbbad
commit
171211c4e2
12 changed files with 46 additions and 16 deletions
|
|
@ -742,7 +742,10 @@ void Trigger::potentialEnterObject(GameBase* enter)
|
|||
{
|
||||
String command = String("%obj = ") + enter->getIdString() + ";";
|
||||
command = command + String("%this = ") + getIdString() + ";" + mEnterCommand;
|
||||
Con::evaluate(command.c_str());
|
||||
|
||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getIdString();
|
||||
String context = String::ToString("%s, %s", getGroup(), objectName);
|
||||
Con::evaluate(command.c_str(), false, context);
|
||||
}
|
||||
|
||||
if( mDataBlock && testTrippable() && testCondition())
|
||||
|
|
@ -791,7 +794,10 @@ void Trigger::processTick(const Move* move)
|
|||
{
|
||||
String command = String("%obj = ") + remove->getIdString() + ";";
|
||||
command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand;
|
||||
Con::evaluate(command.c_str());
|
||||
|
||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getIdString();
|
||||
String context = String::ToString("%s, %s", getGroup(), objectName);
|
||||
Con::evaluate(command.c_str(), false, context);
|
||||
}
|
||||
if (testTrippable() && testCondition())
|
||||
mDataBlock->onLeaveTrigger_callback( this, remove );
|
||||
|
|
@ -800,7 +806,11 @@ void Trigger::processTick(const Move* move)
|
|||
}
|
||||
|
||||
if (evalCmD(&mTickCommand))
|
||||
Con::evaluate(mTickCommand.c_str());
|
||||
{
|
||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getIdString();
|
||||
String context = String::ToString("%s, %s", getGroup(), objectName);
|
||||
Con::evaluate(mTickCommand.c_str(), false, context);
|
||||
}
|
||||
|
||||
if (mObjects.size() != 0 && testTrippable() && testCondition())
|
||||
mDataBlock->onTickTrigger_callback( this );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue