mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 15:22:08 +00:00
- 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:
parent
b3d2a1f074
commit
28c23edb2f
4 changed files with 20 additions and 14 deletions
|
@ -1,4 +1,6 @@
|
|||
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
|
||||
A_KillSiblings.
|
||||
|
||||
|
|
|
@ -1000,10 +1000,12 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
return;
|
||||
}
|
||||
|
||||
DmgFactors * df = target->GetClass()->ActorInfo->DamageFactors;
|
||||
if (!(flags & DMG_NO_FACTOR))
|
||||
{
|
||||
DmgFactors *df = target->GetClass()->ActorInfo->DamageFactors;
|
||||
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)
|
||||
{
|
||||
|
@ -1015,6 +1017,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
damage = FixedMul(damage, target->DamageFactor);
|
||||
if (damage < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
|
||||
}
|
||||
|
|
|
@ -468,6 +468,7 @@ enum EDmgFlags
|
|||
DMG_INFLICTOR_IS_PUFF = 2,
|
||||
DMG_THRUSTLESS = 4,
|
||||
DMG_FORCED = 8,
|
||||
DMG_NO_FACTOR = 16,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1958,7 +1958,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
|
|||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue