summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/p_tick.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/strife/p_tick.c b/src/strife/p_tick.c
index f4ed2711..c0dd4786 100644
--- a/src/strife/p_tick.c
+++ b/src/strife/p_tick.c
@@ -99,11 +99,13 @@ void P_AllocateThinker (thinker_t* thinker)
//
void P_RunThinkers (void)
{
- thinker_t* currentthinker;
+ thinker_t *currentthinker, *nextthinker;
currentthinker = thinkercap.next;
while (currentthinker != &thinkercap)
{
+ nextthinker = currentthinker->next;
+
if ( currentthinker->function.acv == (actionf_v)(-1) )
{
// time to remove it
@@ -116,7 +118,8 @@ void P_RunThinkers (void)
if (currentthinker->function.acp1)
currentthinker->function.acp1 (currentthinker);
}
- currentthinker = currentthinker->next;
+
+ currentthinker = nextthinker;
}
}