From 122f5d9515f2c0f72338f06e44da34bb2930af98 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 31 Aug 2017 11:40:16 +0300 Subject: [PATCH] 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 --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 5b146f2d1..2dfbec49b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -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 (); }