From c0ed6eabd4b70e799cd50b1ab2593224d69119f1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 9 Nov 2019 17:17:49 +0100 Subject: 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. --- engines/kyra/engine/items_eob.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/kyra') 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; -- cgit v1.2.3