[Scummvm-git-logs] scummvm master -> 17d7fa328ab51feeb09044ef0027b2c22b79875b

dreammaster dreammaster at scummvm.org
Fri Mar 30 22:10:21 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
17d7fa328a XEEN: Fix healing and uncursing at the temples


Commit: 17d7fa328ab51feeb09044ef0027b2c22b79875b
    https://github.com/scummvm/scummvm/commit/17d7fa328ab51feeb09044ef0027b2c22b79875b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-30T16:10:17-04:00

Commit Message:
XEEN: Fix healing and uncursing at the temples

Changed paths:
    engines/xeen/locations.cpp
    engines/xeen/locations.h


diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index 7236217..6f8bc82 100644
--- a/engines/xeen/locations.cpp
+++ b/engines/xeen/locations.cpp
@@ -804,7 +804,7 @@ TempleLocation::TempleLocation() : BaseLocation(TEMPLE) {
 	_v10 = _v11 = 0;
 	_v12 = _v13 = 0;
 	_v14 = 0;
-	_flag1 = false;
+	_blessed = false;
 	_v5 = _v6 = 0;
 
 	_icons1.load("esc.icn");
@@ -819,6 +819,10 @@ TempleLocation::TempleLocation() : BaseLocation(TEMPLE) {
 
 Common::String TempleLocation::createLocationText(Character &ch) {
 	Party &party = *g_vm->_party;
+	_donation = 0;
+	_uncurseCost = 0;
+	_healCost = 0;
+	_v5 = _v6 = 0;
 
 	if (party._mazeId == (_ccNum ? 29 : 28)) {
 		_v10 = _v11 = _v12 = _v13 = 0;
@@ -864,17 +868,18 @@ Common::String TempleLocation::createLocationText(Character &ch) {
 		_v5 = (_currentCharLevel * 1000) + (ch._conditions[ERADICATED] * 500) + _v11;
 	}
 
-	for (int idx = 0; idx < 9; ++idx) {
-		_uncurseCost |= ch._weapons[idx]._bonusFlags & 0x40;
-		_uncurseCost |= ch._armor[idx]._bonusFlags & 0x40;
-		_uncurseCost |= ch._accessories[idx]._bonusFlags & 0x40;
-		_uncurseCost |= ch._misc[idx]._bonusFlags & 0x40;
+	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;
 	}
 
-	if (_uncurseCost || ch._conditions[CURSED])
-		_v5 = (_currentCharLevel * 20) + _v10;
+	if (isCursed || ch._conditions[CURSED])
+		_uncurseCost = (_currentCharLevel * 20) + _v10;
 
-	_donation = _flag1 ? 0 : _v14;
+	_donation = _blessed ? 0 : _v14;
 	_healCost += _v6 + _v5;
 
 	return Common::String::format(Res.TEMPLE_TEXT, ch._name.c_str(),
@@ -922,7 +927,7 @@ Character *TempleLocation::doOptions(Character *c) {
 				intf.drawParty(true);
 				sound.stopSound();
 				sound.playSound("ahh.voc");
-				_flag1 = true;
+				_blessed = true;
 				_donation = 0;
 			}
 		}
@@ -964,6 +969,7 @@ Character *TempleLocation::doOptions(Character *c) {
 				c->_misc[idx]._bonusFlags &= ~ITEMFLAG_CURSED;
 			}
 
+			c->_conditions[CURSED] = 0;
 			_farewellTime = 1440;
 			intf.drawParty(true);
 			sound.stopSound();
diff --git a/engines/xeen/locations.h b/engines/xeen/locations.h
index 81f2fe1..3bbd29e 100644
--- a/engines/xeen/locations.h
+++ b/engines/xeen/locations.h
@@ -198,7 +198,7 @@ private:
 	int _dayOfWeek;
 	int _v10, _v11, _v12;
 	int _v13, _v14;
-	bool _flag1;
+	bool _blessed;
 	int _v5, _v6;
 protected:
 	/**





More information about the Scummvm-git-logs mailing list