From dfe19f3551d872d9eab48802bd8ab6e91e8f7422 Mon Sep 17 00:00:00 2001 From: scemino Date: Wed, 15 May 2024 20:21:19 +0200 Subject: [PATCH] TWP: Fix invalid inventory item selected --- engines/twp/scenegraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/twp/scenegraph.cpp b/engines/twp/scenegraph.cpp index df9054f9847..0a0d1496706 100644 --- a/engines/twp/scenegraph.cpp +++ b/engines/twp/scenegraph.cpp @@ -752,7 +752,7 @@ void Inventory::update(float elapsed, Common::SharedPtr actor, const Col if (item.contains(scrPos.getX(), scrPos.getY())) { size_t index = _actor->_inventoryOffset * NUMOBJECTSBYROW + i; if (index < _actor->_inventory.size()) { - _obj = _actor->_inventory[i]; + _obj = _actor->_inventory[index]; if (!_inventoryOver[i] && (_shakeTime[i] < 0.1f)) { _shakeTime[i] = 0.25f;