mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +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 *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));
|
||||
}
|
||||
// Handle passive damage modifiers (e.g. PowerProtection)
|
||||
if (target->Inventory != NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue