aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mads/inventory.cpp4
1 files changed, 2 insertions, 2 deletions
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;