- fixed: PowerProtection clamped its damage minimum to 1, but should do it to 0.

This commit is contained in:
Christoph Oelckers 2017-02-15 21:19:35 +01:00
parent bd86abede3
commit b3d7980b90
2 changed files with 2 additions and 1 deletions

View file

@ -270,6 +270,7 @@ bool DMenu::CallMenuEvent(int mkey, bool fromcontroller)
void DMenu::Close () void DMenu::Close ()
{ {
if (DMenu::CurrentMenu == nullptr) return; // double closing can happen in the save menu.
assert(DMenu::CurrentMenu == this); assert(DMenu::CurrentMenu == this);
DMenu::CurrentMenu = mParentMenu; DMenu::CurrentMenu = mParentMenu;
Destroy(); Destroy();

View file

@ -1767,7 +1767,7 @@ class PowerProtection : Powerup
{ {
if (passive && damage > 0) if (passive && damage > 0)
{ {
newdamage = max(1, ApplyDamageFactors(GetClass(), damageType, damage, damage / 4)); newdamage = max(0, ApplyDamageFactors(GetClass(), damageType, damage, damage / 4));
if (Owner != null && newdamage < damage) Owner.A_PlaySound(ActiveSound, CHAN_AUTO, 1.0, false, ATTN_NONE); if (Owner != null && newdamage < damage) Owner.A_PlaySound(ActiveSound, CHAN_AUTO, 1.0, false, ATTN_NONE);
} }
} }