Skip to content

Commit

Permalink
XEEN: Fix getting items from combat and displaying them in Items dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Feb 25, 2018
1 parent 1cedc60 commit 16bae6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions engines/xeen/combat.cpp
Expand Up @@ -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;
Expand Down
13 changes: 4 additions & 9 deletions engines/xeen/dialogs_items.cpp
Expand Up @@ -136,17 +136,16 @@ 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;

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) {
Expand All @@ -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) {
Expand All @@ -200,7 +196,6 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
));
}
break;
}

default:
break;
Expand Down
3 changes: 2 additions & 1 deletion engines/xeen/party.cpp
Expand Up @@ -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);
}

Expand Down

0 comments on commit 16bae6f

Please sign in to comment.