aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-11-25 08:45:40 -0500
committerPaul Gilbert2017-11-25 08:45:40 -0500
commitab7c0d38cb34038f22ef91f46643d940bf771c62 (patch)
tree64590a1bd869288a6bae7c145b7d133f3615ad35
parent883fd87e8f665c5621f88d7ca8e0c27cbc274ed8 (diff)
downloadscummvm-rg350-ab7c0d38cb34038f22ef91f46643d940bf771c62.tar.gz
scummvm-rg350-ab7c0d38cb34038f22ef91f46643d940bf771c62.tar.bz2
scummvm-rg350-ab7c0d38cb34038f22ef91f46643d940bf771c62.zip
XEEN: Fix for Items dialog item glyphs and crash exiting dialog
-rw-r--r--engines/xeen/dialogs_items.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp
index 5cc8181c17..ffd41d5f75 100644
--- a/engines/xeen/dialogs_items.cpp
+++ b/engines/xeen/dialogs_items.cpp
@@ -62,7 +62,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
screen._windows[30].open();
enum { REDRAW_NONE, REDRAW_TEXT, REDRAW_FULL } redrawFlag = REDRAW_FULL;
- while (!_vm->shouldQuit()) {
+ for (;;) {
if (redrawFlag == REDRAW_FULL) {
if ((mode != ITEMMODE_CHAR_INFO || category != CATEGORY_MISC) && mode != ITEMMODE_ENCHANT
&& mode != ITEMMODE_RECHARGE && mode != ITEMMODE_TO_GOLD) {
@@ -135,8 +135,10 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
}
for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) {
- _itemsDrawList[idx]._x = 8;
- _itemsDrawList[idx]._y = 18 + idx * 9;
+ DrawStruct &ds = _itemsDrawList[idx];
+ ds._sprites = nullptr;
+ ds._x = 8;
+ ds._y = 18 + idx * 9;
switch (category) {
case CATEGORY_WEAPON:
@@ -161,13 +163,12 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
));
}
- DrawStruct &ds = _itemsDrawList[idx];
ds._sprites = &_equipSprites;
if (c->_weapons.passRestrictions(i._id, true))
ds._frame = i._frame;
else
ds._frame = 14;
- } else if (_itemsDrawList[idx]._sprites == nullptr) {
+ } else if (ds._sprites == nullptr) {
lines.push_back(Res.NO_ITEMS_AVAILABLE);
}
break;
@@ -175,7 +176,6 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
case CATEGORY_MISC: {
XeenItem &i = c->_misc[idx];
- _itemsDrawList[idx]._sprites = nullptr;
if (i._material == 0) {
// No item
@@ -319,6 +319,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
if (_buttonValue == Common::KEYCODE_ESCAPE) {
if (mode == ITEMMODE_8)
continue;
+ c = startingChar;
break;
}