aboutsummaryrefslogtreecommitdiff
path: root/scumm/verbs.cpp
diff options
context:
space:
mode:
authorMax Horn2003-07-27 17:33:28 +0000
committerMax Horn2003-07-27 17:33:28 +0000
commit7e54a2f569c4ad435c8dee2252fdc752140e09da (patch)
tree20258d31a2bd0dd4619d2a8efd60e41e49bf6f3b /scumm/verbs.cpp
parent80cbf90a9d613f7b9852f13d54a7e55f22a9e5a3 (diff)
downloadscummvm-rg350-7e54a2f569c4ad435c8dee2252fdc752140e09da.tar.gz
scummvm-rg350-7e54a2f569c4ad435c8dee2252fdc752140e09da.tar.bz2
scummvm-rg350-7e54a2f569c4ad435c8dee2252fdc752140e09da.zip
fix inventory scrolling V1/V2 games (there were problems with an odd inventory count)
svn-id: r9201
Diffstat (limited to 'scumm/verbs.cpp')
-rw-r--r--scumm/verbs.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp
index d8d847cc56..7331358b0c 100644
--- a/scumm/verbs.cpp
+++ b/scumm/verbs.cpp
@@ -212,15 +212,15 @@ void Scumm::checkV2Inventory(int x, int y) {
return;
if (v2_mouseover_boxes[kInventoryUpArrow].rect.contains(x, y)) {
- _inventoryOffset -= 2;
- if (_inventoryOffset < 0)
- _inventoryOffset = 0;
- redrawV2Inventory();
+ if (_inventoryOffset >= 2) {
+ _inventoryOffset -= 2;
+ redrawV2Inventory();
+ }
} else if (v2_mouseover_boxes[kInventoryDownArrow].rect.contains(x, y)) {
- _inventoryOffset += 2;
- if (_inventoryOffset > (getInventoryCount(_scummVars[VAR_EGO])-2))
- _inventoryOffset = (getInventoryCount(_scummVars[VAR_EGO])-2);
- redrawV2Inventory();
+ if (_inventoryOffset + 4 < getInventoryCount(_scummVars[VAR_EGO])) {
+ _inventoryOffset += 2;
+ redrawV2Inventory();
+ }
}
for (object = 0; object < 4; object++) {