From 163d8ba3e60d245d25d067d710152bb13b5ca5c6 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 2 May 2013 00:07:56 +0000 Subject: [PATCH] - Fixed crash when an actor's spawn state ends by destroying the actor and the first state has NoDelay set and it only consists of 0-tic states. SVN r4245 (trunk) --- src/p_mobj.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 6ba3c5579..2c7092da9 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3507,7 +3507,8 @@ void AActor::Tick () // Spawn state, explicitly set the current state so that it calls its // action and chains 0-tic states. int starttics = tics; - SetState(state); + if (!SetState(state)) + return; // freed itself // If the initial state had a duration of 0 tics, let the next state run // normally. Otherwise, increment tics by 1 so that we don't double up ticks. if (starttics > 0 && tics >= 0)