From 59b19d36fb8589ae86873f4851b27f8b4b146987 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Sep 2010 22:33:21 +0000 Subject: [PATCH] - Fixed: AActor::Slam mzst check the charging monster's health before setting it back to its See state. Damaging the target may cause action that might have killed it. SVN r2837 (trunk) --- src/p_mobj.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index d1f0345d8..0257fc23c 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -2626,8 +2626,12 @@ bool AActor::Slam (AActor *thing) int dam = GetMissileDamage (7, 1); P_DamageMobj (thing, this, this, dam, NAME_Melee); P_TraceBleed (dam, thing, this); - if (SeeState != NULL) SetState (SeeState); - else SetIdle(); + // The charging monster may have died by the target's actions here. + if (health > 0) + { + if (SeeState != NULL) SetState (SeeState); + else SetIdle(); + } } else {