From 259e3127feef079e75d7eb14eff6ceb3dc9b619c Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sat, 15 Apr 2017 09:33:04 -0500 Subject: [PATCH] - Fixed crash with corpse queueing. --- src/g_shared/a_action.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index 627c7323d..a15628cb4 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -125,16 +125,19 @@ DCorpsePointer::DCorpsePointer (AActor *ptr) TThinkerIterator iterator (STAT_CORPSEPOINTER); DCorpsePointer *first = iterator.Next (); - if (first != this) + if (first != nullptr) { - if (first->Count >= (uint32_t)sv_corpsequeuesize) + if (first != this) { - DCorpsePointer *next = iterator.Next (); - first->Destroy (); - first = next; + if (first->Count >= (uint32_t)sv_corpsequeuesize) + { + DCorpsePointer *next = iterator.Next(); + first->Destroy(); + first = next; + } } + ++first->Count; } - ++first->Count; } void DCorpsePointer::OnDestroy ()