- Move NULL player check earlier in P_PoisonDamage, before player is accessed.

SVN r4016 (trunk)
This commit is contained in:
Randy Heit 2013-01-03 03:05:44 +00:00
parent 4601954248
commit 814cb4d135

View file

@ -1556,6 +1556,10 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
AActor *target;
AActor *inflictor;
if (player == NULL)
{
return;
}
target = player->mo;
inflictor = source;
if (target->health <= 0)
@ -1567,11 +1571,8 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
{ // target is invulnerable
return;
}
if (player)
{
// Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
}
// Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
// Handle passive damage modifiers (e.g. PowerProtection)
if (target->Inventory != NULL)
{