From 0233c21e33f7458bf1d8ea28e4888831dff71377 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 30 Nov 2016 19:48:52 +0100 Subject: [PATCH] - fixed: When a bogus class is deleted from AllActorClasses, the entry should also be removed from the array instead of leaving a null pointer behind. --- src/scripting/thingdef.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripting/thingdef.cpp b/src/scripting/thingdef.cpp index 77120c947..cdf35283a 100644 --- a/src/scripting/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -387,8 +387,9 @@ void LoadActors () } FScriptPosition::ResetErrorCounter(); - for (auto ti : PClassActor::AllActorClasses) + for (int i = PClassActor::AllActorClasses.Size()-1; i>=0;i--) { + auto ti = PClassActor::AllActorClasses[i]; if (ti->Size == TentativeClass) { if (ti->ObjectFlags & OF_Transient) @@ -400,6 +401,7 @@ void LoadActors () { if (*op == ti) *op = nullptr; } + PClassActor::AllActorClasses.Delete(i); } else {