aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-05-26 12:12:01 -0400
committerPaul Gilbert2014-05-26 12:12:01 -0400
commitc7efc76af65434d171caa94f6eca550cc484289b (patch)
tree8101db5266f0ed9298a7166983bc9821040fa300 /engines
parentd42d523ca2971f3f370476c210edf74ce2b48c5c (diff)
downloadscummvm-rg350-c7efc76af65434d171caa94f6eca550cc484289b.tar.gz
scummvm-rg350-c7efc76af65434d171caa94f6eca550cc484289b.tar.bz2
scummvm-rg350-c7efc76af65434d171caa94f6eca550cc484289b.zip
MADS: Fix inventory scrolling when picking up items
Diffstat (limited to 'engines')
-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 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;