mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
- Move NULL player check earlier in P_PoisonDamage, before player is accessed.
SVN r4016 (trunk)
This commit is contained in:
parent
4601954248
commit
814cb4d135
1 changed files with 6 additions and 5 deletions
|
@ -1556,6 +1556,10 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
||||||
AActor *target;
|
AActor *target;
|
||||||
AActor *inflictor;
|
AActor *inflictor;
|
||||||
|
|
||||||
|
if (player == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
target = player->mo;
|
target = player->mo;
|
||||||
inflictor = source;
|
inflictor = source;
|
||||||
if (target->health <= 0)
|
if (target->health <= 0)
|
||||||
|
@ -1567,11 +1571,8 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
||||||
{ // target is invulnerable
|
{ // target is invulnerable
|
||||||
return;
|
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)
|
// Handle passive damage modifiers (e.g. PowerProtection)
|
||||||
if (target->Inventory != NULL)
|
if (target->Inventory != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue