- Added TELEFRAG_DAMAGE constant, and changed the two places that still used

1000 as the threshold for god mode damage to use it instead. (Players with
  MF2_INVULNERABLE set already used 1000000 as their threshold.)


SVN r1755 (trunk)
This commit is contained in:
Randy Heit 2009-08-07 03:57:03 +00:00
commit 16846fe36d
12 changed files with 29 additions and 32 deletions

View file

@ -889,7 +889,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
}
// Spectral targets only take damage from spectral projectiles.
if (target->flags4 & MF4_SPECTRAL && damage < 1000000)
if (target->flags4 & MF4_SPECTRAL && damage < TELEFRAG_DAMAGE)
{
if (inflictor == NULL || !(inflictor->flags4 & MF4_SPECTRAL))
{
@ -915,7 +915,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
}
return;
}
if ((target->flags2 & MF2_INVULNERABLE) && damage < 1000000 && !(flags & DMG_FORCED))
if ((target->flags2 & MF2_INVULNERABLE) && damage < TELEFRAG_DAMAGE && !(flags & DMG_FORCED))
{ // actor is invulnerable
if (target->player == NULL)
{
@ -1103,22 +1103,17 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
if (!(flags & DMG_FORCED))
{
if ((target->flags2 & MF2_INVULNERABLE) && damage < 1000000)
if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) ||
(target->player->cheats & CF_GODMODE)))
{ // player is invulnerable, so don't hurt him
return;
}
if (damage < 1000 && ((target->player->cheats & CF_GODMODE)
|| (target->player->mo->flags2 & MF2_INVULNERABLE)))
{
return;
}
// [RH] Avoid friendly fire if enabled
if (source != NULL && player != source->player && target->IsTeammate (source))
{
FriendlyFire = true;
if (damage < 1000000)
if (damage < TELEFRAG_DAMAGE)
{ // Still allow telefragging :-(
damage = (int)((float)damage * level.teamdamage);
if (damage <= 0)
@ -1437,7 +1432,8 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
{
return;
}
if (target->flags2&MF2_INVULNERABLE && damage < 1000000)
if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE)))
{ // target is invulnerable
return;
}
@ -1446,11 +1442,6 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
// Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
}
if(damage < 1000 && ((player->cheats&CF_GODMODE)
|| (player->mo->flags2 & MF2_INVULNERABLE)))
{
return;
}
if (damage >= player->health
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
&& !player->morphTics)