From 992ba0bbf48bc797ed891c128ddbcc3d46cdc38a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 26 Jul 2013 00:52:12 +0200 Subject: [PATCH] - added handling of MF3_FOILINVUL for A_BFGSpray. This function needs special treatment because the shooting player is considered the inflictor of the spray damage. --- src/g_doom/a_doomweaps.cpp | 3 ++- src/p_interaction.cpp | 2 +- src/p_local.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 5c5bb7eba1..9dd0557118 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -589,7 +589,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray) damage += (pr_bfgspray() & 7) + 1; thingToHit = linetarget; - int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash)); + int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash), + spray != NULL && (spray->flags3 & MF3_FOILINVUL)? DMG_FOILINVUL : 0); P_TraceBleed (newdam > 0 ? newdam : damage, thingToHit, self->target); } } diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 43499d3533..919bd86545 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -965,7 +965,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, { // actor is invulnerable if (target->player == NULL) { - if (inflictor == NULL || !(inflictor->flags3 & MF3_FOILINVUL)) + if (inflictor == NULL || (!(inflictor->flags3 & MF3_FOILINVUL) && !(flags & DMG_FOILINVUL))) { return -1; } diff --git a/src/p_local.h b/src/p_local.h index a4da0a04b7..e7fb2cb7d5 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -554,6 +554,7 @@ enum EDmgFlags DMG_FORCED = 8, DMG_NO_FACTOR = 16, DMG_PLAYERATTACK = 32, + DMG_FOILINVUL = 64, };