From cadc16293e2e9e0952052f0978c04351fd1e732b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 1 May 2013 02:21:43 +0000 Subject: [PATCH] - Fixed: r4234 moved tic decrementing to the wrong spot. SVN r4243 (trunk) --- src/p_mobj.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 3d8424adc..6ba3c5579 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3495,8 +3495,12 @@ void AActor::Tick () } } - // cycle through states, calling action functions at transitions assert (state != NULL); + if (state == NULL) + { + Destroy(); + return; + } if (ObjectFlags & OF_JustSpawned && state->GetNoDelay()) { // For immediately spawned objects with the NoDelay flag set for their @@ -3511,21 +3515,16 @@ void AActor::Tick () tics++; } } + // cycle through states, calling action functions at transitions if (tics != -1) { // [RH] Use tics <= 0 instead of == 0 so that spawnstates // of 0 tics work as expected. - if (tics <= 0) + if (--tics <= 0) { - if (state == NULL) - { - Destroy(); - return; - } if (!SetState(state->GetNextState())) return; // freed itself } - tics--; } else {