summaryrefslogtreecommitdiff
path: root/src/heretic
diff options
context:
space:
mode:
Diffstat (limited to 'src/heretic')
-rw-r--r--src/heretic/p_tick.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/heretic/p_tick.c b/src/heretic/p_tick.c
index 323cc1e6..ac1c9429 100644
--- a/src/heretic/p_tick.c
+++ b/src/heretic/p_tick.c
@@ -115,10 +115,9 @@ void P_RunThinkers(void)
currentthinker = thinkercap.next;
while (currentthinker != &thinkercap)
{
- nextthinker = currentthinker->next;
-
if (currentthinker->function == (think_t) - 1)
{ // time to remove it
+ nextthinker = currentthinker->next;
currentthinker->next->prev = currentthinker->prev;
currentthinker->prev->next = currentthinker->next;
Z_Free(currentthinker);
@@ -127,6 +126,7 @@ void P_RunThinkers(void)
{
if (currentthinker->function)
currentthinker->function(currentthinker);
+ nextthinker = currentthinker->next;
}
currentthinker = nextthinker;
}