From 62b0fc5f4e43f1072e9b3ebaad029ad842c9009a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Sep 2019 15:41:09 +0200 Subject: [PATCH] - give P_ExplodeMissile a damage type when being called from P_DamageMobj --- src/playsim/p_interaction.cpp | 2 +- src/playsim/p_local.h | 2 +- src/playsim/p_mobj.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playsim/p_interaction.cpp b/src/playsim/p_interaction.cpp index 82ef327fc..745421059 100644 --- a/src/playsim/p_interaction.cpp +++ b/src/playsim/p_interaction.cpp @@ -352,7 +352,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags, FName MeansOf if (flags & MF_MISSILE) { // [RH] When missiles die, they just explode - P_ExplodeMissile (this, NULL, NULL); + P_ExplodeMissile (this, NULL, NULL, false, MeansOfDeath); return; } // [RH] Set the target to the thing that killed it. Strife apparently does this. diff --git a/src/playsim/p_local.h b/src/playsim/p_local.h index c968eb2b8..0c7bb1bc7 100644 --- a/src/playsim/p_local.h +++ b/src/playsim/p_local.h @@ -111,7 +111,7 @@ void P_BloodSplatter (const DVector3 &pos, AActor *originator, DAngle hitangle); void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle); void P_RipperBlood (AActor *mo, AActor *bleeder); int P_GetThingFloorType (AActor *thing); -void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target, bool onsky = false); +void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target, bool onsky = false, FName damageType = NAME_None); AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type); AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL); diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 590c95fea..56e88002b 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -1340,7 +1340,7 @@ bool AActor::Massacre () // //---------------------------------------------------------------------------- -void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky) +void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky, FName damageType) { // [ZZ] line damage callback if (line) @@ -1372,7 +1372,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky) 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, damageType); if (onsky || (line != NULL && line->special == Line_Horizon)) {