- Added a DMG_NO_FACTOR flag for P_DamageMobj(). A_KillChildren, A_KillMaster,

and A_KillSiblings now use it.


SVN r2024 (trunk)
This commit is contained in:
Randy Heit 2009-12-13 05:04:12 +00:00
parent b3d2a1f074
commit 28c23edb2f
4 changed files with 20 additions and 14 deletions

View file

@ -1,4 +1,6 @@
December 12, 2009 December 12, 2009
- Added a DMG_NO_FACTOR flag for P_DamageMobj(). A_KillChildren, A_KillMaster,
and A_KillSiblings now use it.
- Added a damage type parameter to A_KillChildren, A_KillMaster, and - Added a damage type parameter to A_KillChildren, A_KillMaster, and
A_KillSiblings. A_KillSiblings.

View file

@ -1000,10 +1000,12 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
return; return;
} }
DmgFactors * df = target->GetClass()->ActorInfo->DamageFactors; if (!(flags & DMG_NO_FACTOR))
{
DmgFactors *df = target->GetClass()->ActorInfo->DamageFactors;
if (df != NULL) if (df != NULL)
{ {
fixed_t * pdf = df->CheckKey(mod); fixed_t *pdf = df->CheckKey(mod);
if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None); if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None);
if (pdf != NULL) if (pdf != NULL)
{ {
@ -1015,6 +1017,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
damage = FixedMul(damage, target->DamageFactor); damage = FixedMul(damage, target->DamageFactor);
if (damage < 0) if (damage < 0)
return; return;
}
damage = target->TakeSpecialDamage (inflictor, source, damage, mod); damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
} }

View file

@ -468,6 +468,7 @@ enum EDmgFlags
DMG_INFLICTOR_IS_PUFF = 2, DMG_INFLICTOR_IS_PUFF = 2,
DMG_THRUSTLESS = 4, DMG_THRUSTLESS = 4,
DMG_FORCED = 8, DMG_FORCED = 8,
DMG_NO_FACTOR = 16,
}; };

View file

@ -1958,7 +1958,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
if (self->master != NULL) if (self->master != NULL)
{ {
P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR); P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
} }
} }
@ -1979,7 +1979,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren)
{ {
if (mo->master == self) if (mo->master == self)
{ {
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR); P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
} }
} }
} }
@ -2001,7 +2001,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings)
{ {
if (mo->master == self->master && mo != self) if (mo->master == self->master && mo != self)
{ {
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR); P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
} }
} }
} }