- 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.

This commit is contained in:
Christoph Oelckers 2016-11-30 19:48:52 +01:00
parent 07c110d5f7
commit 0233c21e33
1 changed files with 3 additions and 1 deletions

View File

@ -387,8 +387,9 @@ void LoadActors ()
} }
FScriptPosition::ResetErrorCounter(); 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->Size == TentativeClass)
{ {
if (ti->ObjectFlags & OF_Transient) if (ti->ObjectFlags & OF_Transient)
@ -400,6 +401,7 @@ void LoadActors ()
{ {
if (*op == ti) *op = nullptr; if (*op == ti) *op = nullptr;
} }
PClassActor::AllActorClasses.Delete(i);
} }
else else
{ {