aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-09-01 12:33:13 +0200
committerThierry Crozat2018-01-23 02:15:31 +0000
commit3814f33826bbcb7ecb345865c2932eb638d7122c (patch)
tree776553c13246e0c915153ed1e1553b1139fc94c8
parent9f3f9f47ad313a3e9b2d71560f8f98df93b54b07 (diff)
downloadscummvm-rg350-3814f33826bbcb7ecb345865c2932eb638d7122c.tar.gz
scummvm-rg350-3814f33826bbcb7ecb345865c2932eb638d7122c.tar.bz2
scummvm-rg350-3814f33826bbcb7ecb345865c2932eb638d7122c.zip
SUPERNOVA: Scrolls inventory when taking an object
Signed-off-by: Joseph-Eugene Winzer <joewinzer@googlemail.com>
-rw-r--r--engines/supernova/state.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 88957a7c21..04853ca220 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -817,6 +817,10 @@ void GameManager::takeObject(Object &obj) {
obj.setProperty(CARRIED);
obj._click = obj._click2 = 255;
_inventory.add(obj);
+ if (_inventory.getSize() > _inventoryScroll + 8) {
+ _inventoryScroll = _inventory.getSize() - 8;
+ _inventoryScroll += _inventoryScroll % 2;
+ }
}
void GameManager::drawCommandBox() {