[Scummvm-git-logs] scummvm master -> 1bc519aadcc8df4999aa851eae6dfa98d7e9d929

dreammaster dreammaster at scummvm.org
Sat Dec 30 01:47:53 CET 2017


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:
1bc519aadc XEEN: Fix display of given treasure


Commit: 1bc519aadcc8df4999aa851eae6dfa98d7e9d929
    https://github.com/scummvm/scummvm/commit/1bc519aadcc8df4999aa851eae6dfa98d7e9d929
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-29T19:41:59-05:00

Commit Message:
XEEN: Fix display of given treasure

Changed paths:
    engines/xeen/party.cpp
    engines/xeen/resources.cpp


diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index f279b33..250bc56 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -574,7 +574,7 @@ void Party::giveTreasure() {
 	Windows &windows = *_vm->_windows;
 	Window &w = windows[10];
 
-	if (!_treasure._gold && !_treasure._gems)
+	if (!_treasure._hasItems && !_treasure._gold && !_treasure._gems)
 		return;
 
 	bool monstersPresent = false;
@@ -652,7 +652,7 @@ void Party::giveTreasure() {
 				Character &c = _activeParty[charIndex];
 				if (!c._items[(ItemCategory)categoryNum].isFull() && !c.isDisabledOrDead()) {
 					giveTreasureToCharacter(c, (ItemCategory)categoryNum, itemNum);
-					continue;
+					break;
 				}
 			}
 		}
@@ -1100,7 +1100,10 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
 		break;
 	case 21: {
 		int idx;
-		if (giveVal < 35) {
+		if (giveVal >= 82) {
+			_questItems[giveVal - 82]++;
+		}
+		if (giveVal < 35 || giveVal >= 82) {
 			for (idx = 0; idx < 10 && _treasure._weapons[idx]._id; ++idx);
 			if (idx < 10) {
 				_treasure._weapons[idx]._id = giveVal;
@@ -1121,16 +1124,13 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
 				_treasure._hasItems = true;
 				return false;
 			}
-		} else if (giveVal < 82) {
+		} else {
 			for (idx = 0; idx < 10 && _treasure._misc[idx]._material; ++idx);
 			if (idx < 10) {
 				_treasure._accessories[idx]._material = giveVal - 60;
 				_treasure._hasItems = true;
 				return false;
 			}
-		} else {
-			_questItems[giveVal - 82]++;
-			return false;
 		}
 		return true;
 	}	
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index 7edd920..f9b6548 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -1581,7 +1581,7 @@ const char *const Resources::BACKPACKS_FULL_PRESS_KEY =
 	"\v007\f12Warning!  BackPacks Full!\fd\n"
 	"Press a Key";
 
-const char *const Resources::HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\f'd";
+const char *const Resources::HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\xC""d";
 
 const char *const Resources::GIVE_TREASURE_FORMATTING =
 	"\x3l\v060\t000\x4""077\n"





More information about the Scummvm-git-logs mailing list