From 46ee2c5ec685fc2f926a5008b0b582359e798727 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Fri, 27 Jan 2017 10:21:22 -0600 Subject: [PATCH] - Fixed HITTARGET, HITMASTER, HITTRACER, crash and xdeath states being broken on bouncing actors that die/explode. --- src/p_map.cpp | 4 ++-- src/p_mobj.cpp | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 4e5cc31fd..435478756 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3535,9 +3535,9 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop) if (mo->bouncecount>0 && --mo->bouncecount == 0) { if (mo->flags & MF_MISSILE) - P_ExplodeMissile(mo, nullptr, nullptr); + P_ExplodeMissile(mo, nullptr, BlockingMobj); else - mo->CallDie(nullptr, nullptr); + mo->CallDie(BlockingMobj, nullptr); return true; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 807326d78..bd31af4a1 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1814,15 +1814,18 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) mo->effects = 0; // [RH] mo->flags &= ~MF_SHOOTABLE; - FState *nextstate=NULL; + FState *nextstate = nullptr; - if (target != NULL && ((target->flags & (MF_SHOOTABLE|MF_CORPSE)) || (target->flags6 & MF6_KILLED)) ) + if (target != nullptr) { if (mo->flags7 & MF7_HITTARGET) mo->target = target; if (mo->flags7 & MF7_HITMASTER) mo->master = target; if (mo->flags7 & MF7_HITTRACER) mo->tracer = target; - if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash); - if (nextstate == NULL) nextstate = mo->FindState(NAME_Death, NAME_Extreme); + if ((target->flags & (MF_SHOOTABLE | MF_CORPSE)) || (target->flags6 & MF6_KILLED)) + { + if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash); + if (nextstate == NULL) nextstate = mo->FindState(NAME_Death, NAME_Extreme); + } } if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);