mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 23:32:02 +00:00
- fixed: With the recent changes to the damage code, the check for MF5_NODAMAGE was too early. Putting it into AActor::TakeSpecialDamage is also not the best idea because that limits that function's potential.
This commit is contained in:
parent
d481ba7b5a
commit
d940c6a2ee
2 changed files with 5 additions and 5 deletions
|
@ -1038,6 +1038,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
// Invulnerable, and won't wake up
|
// Invulnerable, and won't wake up
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect.
|
if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect.
|
||||||
{
|
{
|
||||||
player = target->player;
|
player = target->player;
|
||||||
|
@ -1116,6 +1117,10 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (target->flags5 & MF5_NODAMAGE)
|
||||||
|
{
|
||||||
|
damage = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
|
|
|
@ -6159,11 +6159,6 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
|
||||||
{
|
{
|
||||||
FState *death;
|
FState *death;
|
||||||
|
|
||||||
if (flags5 & MF5_NODAMAGE)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the actor does not have a corresponding death state, then it does not take damage.
|
// If the actor does not have a corresponding death state, then it does not take damage.
|
||||||
// Note that DeathState matches every kind of damagetype, so an actor has that, it can
|
// Note that DeathState matches every kind of damagetype, so an actor has that, it can
|
||||||
// be hurt with any type of damage. Exception: Massacre damage always succeeds, because
|
// be hurt with any type of damage. Exception: Massacre damage always succeeds, because
|
||||||
|
|
Loading…
Reference in a new issue