diff options
Diffstat (limited to 'src/hexen')
-rw-r--r-- | src/hexen/p_tick.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/hexen/p_tick.c b/src/hexen/p_tick.c index 95242ccd..c58d6e82 100644 --- a/src/hexen/p_tick.c +++ b/src/hexen/p_tick.c @@ -86,11 +86,13 @@ void P_Ticker(void) static void RunThinkers(void) { - thinker_t *currentthinker; + thinker_t *currentthinker, *nextthinker; currentthinker = thinkercap.next; while (currentthinker != &thinkercap) { + nextthinker = currentthinker->next; + if (currentthinker->function == (think_t) - 1) { // Time to remove it currentthinker->next->prev = currentthinker->prev; @@ -101,7 +103,8 @@ static void RunThinkers(void) { currentthinker->function(currentthinker); } - currentthinker = currentthinker->next; + + currentthinker = nextthinker; } } |