- Added DMSS_NOFACTOR for all A_Damage functions.

This commit is contained in:
MajorCooke 2014-10-02 11:48:07 -05:00
parent 7a6e704af6
commit 5030832df0
2 changed files with 28 additions and 8 deletions

View file

@ -4830,6 +4830,7 @@ enum DMSS
DMSS_FOILINVUL = 1, DMSS_FOILINVUL = 1,
DMSS_AFFECTARMOR = 2, DMSS_AFFECTARMOR = 2,
DMSS_KILL = 4, DMSS_KILL = 4,
DMSS_NOFACTOR = 8,
}; };
static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageType, int flags) static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageType, int flags)
@ -4844,15 +4845,29 @@ static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageTy
} }
if (flags & DMSS_AFFECTARMOR) 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 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. //[MC] DMG_FOILINVUL is needed for making the damage occur on the actor.
else
{
P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR); P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR);
} }
} }
} }
}
else if (amount < 0) else if (amount < 0)
{ {
amount = -amount; amount = -amount;
@ -5128,11 +5143,13 @@ static void DoRemove(AActor *removetarget, int flags)
// A_RemoveTarget // 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 // 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);
} }
} }

View file

@ -375,6 +375,7 @@ const int KILS_NOMONSTERS = 4;
const int DMSS_FOILINVUL = 1; const int DMSS_FOILINVUL = 1;
const int DMSS_AFFECTARMOR = 2; const int DMSS_AFFECTARMOR = 2;
const int DMSS_KILL = 4; const int DMSS_KILL = 4;
const int DMSS_NOFACTOR = 8;
// Flags for A_AlertMonsters // Flags for A_AlertMonsters
const int AMF_TARGETEMITTER = 1; const int AMF_TARGETEMITTER = 1;