[Scummvm-git-logs] scummvm master -> 16bae6f314f36e5d61a7148e5f754e99698f3e82

dreammaster dreammaster at scummvm.org
Sun Feb 25 02:12:37 CET 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:
16bae6f314 XEEN: Fix getting items from combat and displaying them in Items dialog


Commit: 16bae6f314f36e5d61a7148e5f754e99698f3e82
    https://github.com/scummvm/scummvm/commit/16bae6f314f36e5d61a7148e5f754e99698f3e82
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-24T20:12:24-05:00

Commit Message:
XEEN: Fix getting items from combat and displaying them in Items dialog

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/dialogs_items.cpp
    engines/xeen/party.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index ddda240..2f512f6 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -1511,6 +1511,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
 			party._treasure._gems = monsterData._gems;
 
 			if (!isDarkCc && monster._spriteId == 89) {
+				// Xeen's Scepter of Temporal Distortion
 				party._treasure._weapons[0]._id = 90;
 				party._treasure._weapons[0]._bonusFlags = 0;
 				party._treasure._weapons[0]._material = 0;
diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp
index bf0e40e..865ec23 100644
--- a/engines/xeen/dialogs_items.cpp
+++ b/engines/xeen/dialogs_items.cpp
@@ -136,6 +136,8 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
 
 			for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) {
 				DrawStruct &ds = _itemsDrawList[idx];
+				XeenItem &i = c->_items[category][idx];
+
 				ds._sprites = nullptr;
 				ds._x = 8;
 				ds._y = 18 + idx * 9;
@@ -143,10 +145,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
 				switch (category) {
 				case CATEGORY_WEAPON:
 				case CATEGORY_ARMOR:
-				case CATEGORY_ACCESSORY: {
-					XeenItem &i = (category == CATEGORY_WEAPON) ? c->_weapons[idx] :
-						((category == CATEGORY_ARMOR) ? c->_armor[idx] : c->_accessories[idx]);
-
+				case CATEGORY_ACCESSORY:
 					if (i._id) {
 						if (mode == ITEMMODE_CHAR_INFO || mode == ITEMMODE_8
 								|| mode == ITEMMODE_ENCHANT || mode == ITEMMODE_RECHARGE) {
@@ -172,11 +171,8 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
 						lines.push_back(Res.NO_ITEMS_AVAILABLE);
 					}
 					break;
-				}
-
-				case CATEGORY_MISC: {
-					XeenItem &i = c->_misc[idx];
 
+				case CATEGORY_MISC:
 					if (i._material == 0) {
 						// No item
 						if (idx == 0) {
@@ -200,7 +196,6 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
 						));
 					}
 					break;
-				}
 
 				default:
 					break;
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index d45c7fa..b24030d 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -720,9 +720,10 @@ void Party::giveTreasureToCharacter(Character &c, ItemCategory category, int ite
 	w.update();
 	events.ipause(5);
 
-	const char *itemName = XeenItem::getItemName(category, treasureItem._id);
+ 	const char *itemName = XeenItem::getItemName(category, treasureItem._id);
 	w.writeString(Common::String::format(Res.X_FOUND_Y, c._name.c_str(), itemName));
 	w.update();
+	c._items[category].sort();
 	events.ipause(5);
 }
 





More information about the Scummvm-git-logs mailing list