Fixed crash caused by script number collision of ACS typed scripts

Wrong typed script can be picked when the same ACS script number is used for different script types from multiple behavior lumps
Although script in particular state is discarded and null pointer could be dereferenced
https://forum.zdoom.org/viewtopic.php?t=57718
This commit is contained in:
alexey.lysiuk 2017-08-31 11:40:16 +03:00
parent ca55d8993f
commit 122f5d9515

View file

@ -3439,7 +3439,7 @@ void FBehavior::StartTypedScripts (uint16_t type, AActor *activator, bool always
{
DLevelScript *runningScript = P_GetScriptGoing (activator, NULL, ptr->Number,
ptr, this, &arg1, 1, always ? ACS_ALWAYS : 0);
if (runNow)
if (nullptr != runningScript && runNow)
{
runningScript->RunScript ();
}