diff --git a/docs/rh-log.txt b/docs/rh-log.txt index cd78d4d9d0..19dc7f7d10 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -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. diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 3c8f715f5e..003e0077ee 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1000,21 +1000,24 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage return; } - DmgFactors * df = target->GetClass()->ActorInfo->DamageFactors; - if (df != NULL) + if (!(flags & DMG_NO_FACTOR)) { - fixed_t * pdf = df->CheckKey(mod); - if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None); - if (pdf != NULL) + DmgFactors *df = target->GetClass()->ActorInfo->DamageFactors; + if (df != NULL) { - damage = FixedMul(damage, *pdf); - if (damage <= 0) - return; + fixed_t *pdf = df->CheckKey(mod); + if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None); + if (pdf != NULL) + { + damage = FixedMul(damage, *pdf); + if (damage <= 0) + return; + } } + damage = FixedMul(damage, target->DamageFactor); + if (damage < 0) + return; } - damage = FixedMul(damage, target->DamageFactor); - if (damage < 0) - return; damage = target->TakeSpecialDamage (inflictor, source, damage, mod); } diff --git a/src/p_local.h b/src/p_local.h index 415ac46ca3..27654aafa2 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -468,6 +468,7 @@ enum EDmgFlags DMG_INFLICTOR_IS_PUFF = 2, DMG_THRUSTLESS = 4, DMG_FORCED = 8, + DMG_NO_FACTOR = 16, }; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 441304ea18..cf8a2f5e40 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -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); } } }