From c7efc76af65434d171caa94f6eca550cc484289b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 26 May 2014 12:12:01 -0400 Subject: MADS: Fix inventory scrolling when picking up items --- engines/mads/inventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index 434d284244..b7864bc6a7 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -150,10 +150,10 @@ void InventoryObjects::addToInventory(int objectId) { _inventoryList.push_back(objectId); userInterface._selectedInvIndex = _inventoryList.size() - 1; userInterface._inventoryTopIndex = CLIP(userInterface._inventoryTopIndex, - 0, (int)_inventoryList.size() - 1); + 0, userInterface._selectedInvIndex); if ((userInterface._inventoryTopIndex + 5) <= (int)_inventoryList.size()) - userInterface._inventoryTopIndex = size() - 4; + userInterface._inventoryTopIndex = _inventoryList.size() - 5; userInterface._inventoryChanged = true; (*this)[objectId]._roomNumber = PLAYER_INVENTORY; -- cgit v1.2.3