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
|
|
@ -160,7 +160,8 @@ S32 FuncVars::assign(StringTableEntry var, TypeReq currentType, S32 lineNumber,
|
|||
|
||||
if (found->second.isConstant)
|
||||
{
|
||||
const char* str = avar("Script Warning: Reassigning variable %s when it is a constant. File: %s Line : %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber);
|
||||
const char* lineTxt = CodeBlock::smCurrentLineText;
|
||||
const char* str = avar("Script Warning: Reassigning variable %s when it is a constant. File: %s Line Num: %d \nLine: %s", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber, lineTxt);
|
||||
scriptErrorHandler(str);
|
||||
}
|
||||
return found->second.reg;
|
||||
|
|
@ -179,7 +180,8 @@ S32 FuncVars::lookup(StringTableEntry var, S32 lineNumber)
|
|||
|
||||
if (found == vars.end())
|
||||
{
|
||||
const char* str = avar("Script Warning: Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber);
|
||||
const char* lineTxt = CodeBlock::smCurrentLineText;
|
||||
const char* str = avar("Script Warning: Variable %s referenced before used when compiling script. File: %s Line Num: %d \nLine: %s", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber, lineTxt);
|
||||
scriptErrorHandler(str);
|
||||
|
||||
return assign(var, TypeReqString, lineNumber, false);
|
||||
|
|
@ -194,7 +196,8 @@ TypeReq FuncVars::lookupType(StringTableEntry var, S32 lineNumber)
|
|||
|
||||
if (found == vars.end())
|
||||
{
|
||||
const char* str = avar("Script Warning: Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber);
|
||||
const char* lineText = CodeBlock::smCurrentLineText;
|
||||
const char* str = avar("Script Warning: Variable %s referenced before used when compiling script. File: %s Line Num: %d \nLine: %s", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber, lineText);
|
||||
scriptErrorHandler(str);
|
||||
|
||||
assign(var, TypeReqString, lineNumber, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue