diff options
author | Paul Gilbert | 2018-03-31 12:37:36 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-03-31 12:37:36 -0400 |
commit | 31bcb0961981e3e647b2de912927145e8e9429aa (patch) | |
tree | 0bc9f8c159820509b3bf8628a80b4345050488c0 /engines/xeen/locations.cpp | |
parent | 572dbd86239426c54776f02a538f1bea45f4abd3 (diff) | |
download | scummvm-rg350-31bcb0961981e3e647b2de912927145e8e9429aa.tar.gz scummvm-rg350-31bcb0961981e3e647b2de912927145e8e9429aa.tar.bz2 scummvm-rg350-31bcb0961981e3e647b2de912927145e8e9429aa.zip |
XEEN: Cleanup of item bonus flags to a bitfield state structure
Diffstat (limited to 'engines/xeen/locations.cpp')
-rw-r--r-- | engines/xeen/locations.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp index 6f8bc82470..9b0eec382a 100644 --- a/engines/xeen/locations.cpp +++ b/engines/xeen/locations.cpp @@ -868,14 +868,7 @@ Common::String TempleLocation::createLocationText(Character &ch) { _v5 = (_currentCharLevel * 1000) + (ch._conditions[ERADICATED] * 500) + _v11; } - bool isCursed = false; - for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) { - isCursed |= (ch._weapons[idx]._bonusFlags & ITEMFLAG_CURSED) != 0; - isCursed |= (ch._armor[idx]._bonusFlags & ITEMFLAG_CURSED) != 0; - isCursed |= (ch._accessories[idx]._bonusFlags & ITEMFLAG_CURSED) != 0; - isCursed |= (ch._misc[idx]._bonusFlags & ITEMFLAG_CURSED) != 0; - } - + bool isCursed = ch._items.hasCursedItems(); if (isCursed || ch._conditions[CURSED]) _uncurseCost = (_currentCharLevel * 20) + _v10; @@ -962,13 +955,7 @@ Character *TempleLocation::doOptions(Character *c) { case Common::KEYCODE_u: if (_uncurseCost && party.subtract(CONS_GOLD, _uncurseCost, WHERE_PARTY, WT_LOC_WAIT)) { - for (int idx = 0; idx < 9; ++idx) { - c->_weapons[idx]._bonusFlags &= ~ITEMFLAG_CURSED; - c->_armor[idx]._bonusFlags &= ~ITEMFLAG_CURSED; - c->_accessories[idx]._bonusFlags &= ~ITEMFLAG_CURSED; - c->_misc[idx]._bonusFlags &= ~ITEMFLAG_CURSED; - } - + c->_items.curseUncurse(false); c->_conditions[CURSED] = 0; _farewellTime = 1440; intf.drawParty(true); |