- Fixed crash with corpse queueing.

This commit is contained in:
Major Cooke 2017-04-15 09:33:04 -05:00 committed by Christoph Oelckers
parent 1ee9256842
commit 259e3127fe
1 changed files with 9 additions and 6 deletions

View File

@ -125,16 +125,19 @@ DCorpsePointer::DCorpsePointer (AActor *ptr)
TThinkerIterator<DCorpsePointer> 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 ()