- Fixed HITTARGET, HITMASTER, HITTRACER, crash and xdeath states being broken on bouncing actors that die/explode.

This commit is contained in:
Major Cooke 2017-01-27 10:21:22 -06:00 committed by Christoph Oelckers
parent 1eb2c75328
commit 46ee2c5ec6
2 changed files with 9 additions and 6 deletions

View file

@ -3535,9 +3535,9 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
if (mo->bouncecount>0 && --mo->bouncecount == 0) if (mo->bouncecount>0 && --mo->bouncecount == 0)
{ {
if (mo->flags & MF_MISSILE) if (mo->flags & MF_MISSILE)
P_ExplodeMissile(mo, nullptr, nullptr); P_ExplodeMissile(mo, nullptr, BlockingMobj);
else else
mo->CallDie(nullptr, nullptr); mo->CallDie(BlockingMobj, nullptr);
return true; return true;
} }

View file

@ -1814,16 +1814,19 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
mo->effects = 0; // [RH] mo->effects = 0; // [RH]
mo->flags &= ~MF_SHOOTABLE; 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_HITTARGET) mo->target = target;
if (mo->flags7 & MF7_HITMASTER) mo->master = target; if (mo->flags7 & MF7_HITMASTER) mo->master = target;
if (mo->flags7 & MF7_HITTRACER) mo->tracer = target; if (mo->flags7 & MF7_HITTRACER) mo->tracer = target;
if ((target->flags & (MF_SHOOTABLE | MF_CORPSE)) || (target->flags6 & MF6_KILLED))
{
if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash); 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, NAME_Extreme);
} }
}
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death); if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);
if (line != NULL && line->special == Line_Horizon && !(mo->flags3 & MF3_SKYEXPLODE)) if (line != NULL && line->special == Line_Horizon && !(mo->flags3 & MF3_SKYEXPLODE))