From 5030832df0141a7598f5a6d4363f3febf3711829 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Thu, 2 Oct 2014 11:48:07 -0500 Subject: [PATCH] - Added DMSS_NOFACTOR for all A_Damage functions. --- src/thingdef/thingdef_codeptr.cpp | 35 +++++++++++++++++++++++------- wadsrc/static/actors/constants.txt | 1 + 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e724a1ba2..65888d0d5 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4830,6 +4830,7 @@ enum DMSS DMSS_FOILINVUL = 1, DMSS_AFFECTARMOR = 2, DMSS_KILL = 4, + DMSS_NOFACTOR = 8, }; static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageType, int flags) @@ -4844,12 +4845,26 @@ static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageTy } if (flags & DMSS_AFFECTARMOR) { - P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL); + if (flags & DMSS_NOFACTOR) + { + P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_FACTOR); + } + else + { + P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL); + } } else { + if (flags & DMSS_NOFACTOR) + { + P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR | DMG_NO_FACTOR); + } //[MC] DMG_FOILINVUL is needed for making the damage occur on the actor. - P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR); + else + { + P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR); + } } } } @@ -5128,11 +5143,13 @@ static void DoRemove(AActor *removetarget, int flags) // A_RemoveTarget // //=========================================================================== -DEFINE_ACTION_FUNCTION(AActor, A_RemoveTarget) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveTarget) { - if ((self->target != NULL)) + ACTION_PARAM_START(1); + ACTION_PARAM_INT(flags, 0); + if (self->master != NULL) { - P_RemoveThing(self->target); + DoRemove(self->target, flags); } } @@ -5141,11 +5158,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemoveTarget) // A_RemoveTracer // //=========================================================================== -DEFINE_ACTION_FUNCTION(AActor, A_RemoveTracer) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveTracer) { - if ((self->tracer != NULL)) + ACTION_PARAM_START(1); + ACTION_PARAM_INT(flags, 0); + if (self->master != NULL) { - P_RemoveThing(self->tracer); + DoRemove(self->tracer, flags); } } diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 1fe8e75cb..57de8e6ad 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -375,6 +375,7 @@ const int KILS_NOMONSTERS = 4; const int DMSS_FOILINVUL = 1; const int DMSS_AFFECTARMOR = 2; const int DMSS_KILL = 4; +const int DMSS_NOFACTOR = 8; // Flags for A_AlertMonsters const int AMF_TARGETEMITTER = 1;