diff options
author | Paul Gilbert | 2018-03-31 11:43:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-03-31 11:43:11 -0400 |
commit | 572dbd86239426c54776f02a538f1bea45f4abd3 (patch) | |
tree | 3c49fb47576eabf5273fa8f82d59c780c3d071c6 | |
parent | 23ca6c9e1b9d1553e12bb3356aa7a267b5c4ee36 (diff) | |
download | scummvm-rg350-572dbd86239426c54776f02a538f1bea45f4abd3.tar.gz scummvm-rg350-572dbd86239426c54776f02a538f1bea45f4abd3.tar.bz2 scummvm-rg350-572dbd86239426c54776f02a538f1bea45f4abd3.zip |
XEEN: Armor breaks at -10 HP, not 10 HP
-rw-r--r-- | engines/xeen/character.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index 72d8ed653e..2eb37bcbeb 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -1222,7 +1222,7 @@ void Character::subtractHitPoints(int amount) { // Subtract the given HP amount _currentHp -= amount; - bool flag = _currentHp <= 10; + bool breakFlag = _currentHp <= -10; assert(_currentHp < 65000); if (_currentHp < 1) { @@ -1232,13 +1232,13 @@ void Character::subtractHitPoints(int amount) { sound.playFX(38); } else { _conditions[DEAD] = 1; - flag = true; + breakFlag = true; if (_currentHp > 0) _currentHp = 0; } - if (flag) { - // Check for breaking equipped armor + if (breakFlag) { + // Break any equipped armor the character has for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) { XeenItem &item = _armor[idx]; if (item._id && item._frame) |