summaryrefslogtreecommitdiff
path: root/src/hexen
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen')
-rw-r--r--src/hexen/p_tick.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hexen/p_tick.c b/src/hexen/p_tick.c
index c58d6e82..3d3dd389 100644
--- a/src/hexen/p_tick.c
+++ b/src/hexen/p_tick.c
@@ -91,17 +91,18 @@ static void 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);
}
- else if (currentthinker->function)
+ else
{
- currentthinker->function(currentthinker);
+ if (currentthinker->function)
+ currentthinker->function(currentthinker);
+ nextthinker = currentthinker->next;
}
currentthinker = nextthinker;