From 18e46448de492abb07c8eb6025be3b8708f104e0 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Nov 2024 18:24:58 +0100 Subject: [PATCH] init polyobject thinker references to 0 otherwise its uncertain and very unlikely for them to be removed P_RemoveThinker(Delayed) checks if thinkers are still referenced before removal. polyobject thinkers never initialised the reference count but called thinker removal, this lead to checking unitialised values and those thinkers getting stuck in removal limbo without ever being actually removed --- src/p_polyobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_polyobj.c b/src/p_polyobj.c index fa98ad9a..eef53bd1 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -150,6 +150,8 @@ FUNCINLINE static ATTRINLINE void PolyObj_AddThinker(thinker_t *th) th->next = thinkercap.next; th->prev = &thinkercap; thinkercap.next = th; + + th->references = 0; // init to 0 so they can be properly removed } //