Shifted CodeBlock::smCurrentLineText to be a const char* so it's use is clearer

Ensured CodeBlock::smCurrentLineText is cleared at the end of execution
Tweaked and cleaned up the context lines passed along for further debugging data in the event of a script assert
This commit is contained in:
JeffR 2026-02-22 18:18:42 -06:00
parent 171211c4e2
commit 9084e81bc1
11 changed files with 107 additions and 23 deletions

View file

@ -60,7 +60,7 @@ inline FuncVars* getFuncVars(S32 lineNumber)
if (gFuncVars == &gGlobalScopeFuncVars)
{
const char* lineTxt = CodeBlock::smCurrentLineText;
const char* str = avar("Attemping to use local variable in global scope. File: %s Line Num: %d \nLine: %s", CodeBlock::smCurrentParser->getCurrentFile(), lineNumber, lineTxt);
const char* str = avar("Attemping to use local variable in global scope. File: %s\nLine Num: %d\nLine: \"%s\"", CodeBlock::smCurrentParser->getCurrentFile(), lineNumber, lineTxt);
scriptErrorHandler(str);
}
return gFuncVars;