- there seem to be ACS compilers which let 'delay' pass inside a function. Since this is an unsupported feature which brings the ACS VM into an unstable state it has to be handled with a hard abort to avoid crashes.

This commit is contained in:
Christoph Oelckers 2017-01-24 11:59:59 +01:00
parent e3c36998b6
commit 02f678dccc

View file

@ -9716,7 +9716,16 @@ scriptwait:
if (runaway != 0 && InModuleScriptNumber >= 0)
{
activeBehavior->GetScriptPtr(InModuleScriptNumber)->ProfileData.AddRun(runaway);
auto scriptptr = activeBehavior->GetScriptPtr(InModuleScriptNumber);
if (scriptptr != nullptr)
{
scriptptr->ProfileData.AddRun(runaway);
}
else
{
// It is pointless to continue execution. The script is broken and needs to be aborted.
I_Error("Bad script definition encountered. Script %d is reported running but not present.\nThe most likely cause for this message is using 'delay' inside a function which is not supported.\nPlease check the ACS compiler used for compiling the script!", InModuleScriptNumber);
}
}
if (state == SCRIPT_DivideBy0)