diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index a15628cb40..fe4ab9d4b0 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -85,6 +85,7 @@ class DCorpsePointer : public DThinker HAS_OBJECT_POINTERS public: DCorpsePointer (AActor *ptr); + void Queue(); void OnDestroy() override; void Serialize(FSerializer &arc); TObjPtr Corpse; @@ -115,11 +116,14 @@ CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO) } -DCorpsePointer::DCorpsePointer (AActor *ptr) -: DThinker (STAT_CORPSEPOINTER), Corpse (ptr) +DCorpsePointer::DCorpsePointer(AActor *ptr) + : DThinker(STAT_CORPSEPOINTER), Corpse(ptr) { Count = 0; +} +void DCorpsePointer::Queue() +{ // Thinkers are added to the end of their respective lists, so // the first thinker in the list is the oldest one. TThinkerIterator iterator (STAT_CORPSEPOINTER); @@ -184,7 +188,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse) if (sv_corpsequeuesize > 0) { - Create (self); + auto p = Create (self); + p->Queue(); } return 0; }