aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/inventory.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-10 20:06:02 -0400
committerPaul Gilbert2014-04-10 20:06:02 -0400
commitda43f4438d44e2fee8fb8e99fd463e2c702e683e (patch)
tree9d922b08aea9c4ca764e3e86b2f1b4ab9cec0b1d /engines/mads/inventory.cpp
parentdbbfdeec8fb2d042844cee67c91c7d639f2a8eaa (diff)
downloadscummvm-rg350-da43f4438d44e2fee8fb8e99fd463e2c702e683e.tar.gz
scummvm-rg350-da43f4438d44e2fee8fb8e99fd463e2c702e683e.tar.bz2
scummvm-rg350-da43f4438d44e2fee8fb8e99fd463e2c702e683e.zip
MADS: Minor fix to inentory top index setting
Diffstat (limited to 'engines/mads/inventory.cpp')
-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;