aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2019-11-09 17:17:49 +0100
committerathrxx2019-11-09 17:22:21 +0100
commitc0ed6eabd4b70e799cd50b1ab2593224d69119f1 (patch)
treec54ffa01fae9601ee276ed68336180c060a9d710
parent843e0f6a4b23e5d92b38d8a358331491b6f003b5 (diff)
downloadscummvm-rg350-c0ed6eabd4b70e799cd50b1ab2593224d69119f1.tar.gz
scummvm-rg350-c0ed6eabd4b70e799cd50b1ab2593224d69119f1.tar.bz2
scummvm-rg350-c0ed6eabd4b70e799cd50b1ab2593224d69119f1.zip
KYRA: (EOB2) - workaround for minor graphics glitch
The game would actually allow placing the 4 horns or the large red rings from the ringmaster riddle into the inventory ring slots. Simply, because these items are flagged that way in the data file (itemtype.dat). I wasn't aware of this until I happened to come across some youtube video. The video was from DosBox, but this doesn't make a difference. This patch prevents placing these items into the ring slots.
-rw-r--r--engines/kyra/engine/items_eob.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/kyra/engine/items_eob.cpp b/engines/kyra/engine/items_eob.cpp
index 39054b614d..3121f567f8 100644
--- a/engines/kyra/engine/items_eob.cpp
+++ b/engines/kyra/engine/items_eob.cpp
@@ -217,6 +217,14 @@ int EoBCoreEngine::validateInventorySlotForItem(Item item, int charIndex, int sl
}
uint16 v = item ? _itemTypes[_items[item].type].invFlags : 0xFFFF;
+
+ // WORKAROUND: The game allows putting the 4 horns and the red rings from the ringmaster riddle into inventory ring slots.
+ // This causes a graphics glitch, since these items are too large for that slot. I prevent this here. Patching it while
+ // loading up items.dat and itemtypes.dat would be preferable but seems too complicated (if not impossible), since the inv
+ // flags are part of itemtypes.dat and it might be wrong to patch these flags for the whole item type.
+ if (_flags.gameID == GI_EOB2 && (_items[item].icon == 107 || _items[item].icon == 61))
+ v &= ~0x100;
+
if (v & _slotValidationFlags[slot])
return 1;