From da43f4438d44e2fee8fb8e99fd463e2c702e683e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 10 Apr 2014 20:06:02 -0400 Subject: MADS: Minor fix to inentory top index setting --- engines/mads/inventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index 0795233f6c..bb65430bb1 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -110,8 +110,8 @@ void InventoryObjects::addToInventory(int objectId) { userInterface._inventoryTopIndex = CLIP(userInterface._inventoryTopIndex, 0, (int)_inventoryList.size() - 1); - if ((userInterface._inventoryTopIndex + 5) < (int)_inventoryList.size()) - userInterface._inventoryTopIndex = size() - 5; + if ((userInterface._inventoryTopIndex + 5) <= (int)_inventoryList.size()) + userInterface._inventoryTopIndex = size() - 4; userInterface._inventoryChanged = true; (*this)[objectId]._roomNumber = PLAYER_INVENTORY; -- cgit v1.2.3