aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRobert Špalek2009-11-22 20:25:27 +0000
committerRobert Špalek2009-11-22 20:25:27 +0000
commit772b89682d7ae314d1b776f6c47ab10ac6d865cb (patch)
tree1a05d763c1c937d205150d8bd459f82941f58fed /engines
parent00063b142303483cfea7fc2522ac45daaa7025f4 (diff)
downloadscummvm-rg350-772b89682d7ae314d1b776f6c47ab10ac6d865cb.tar.gz
scummvm-rg350-772b89682d7ae314d1b776f6c47ab10ac6d865cb.tar.bz2
scummvm-rg350-772b89682d7ae314d1b776f6c47ab10ac6d865cb.zip
Make sure hands are empty after loading the game
(otherwise we could have in our hands an unreachable object). This works thanks to moving clearing _currentItem into putItem(), which gets called in inventoryReload(). svn-id: r46096
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/game.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index dd4d6f7961..d34b43645a 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -249,7 +249,6 @@ void Game::handleOrdinaryLoop(int x, int y) {
if (_currentItem) {
putItem(_currentItem, 0);
- _currentItem = NULL;
updateOrdinaryCursor();
} else {
if (_objUnderCursor) {
@@ -341,9 +340,7 @@ void Game::handleInventoryLoop() {
kInventoryItemHeight) - 1, 0L, (long) kInventoryLines - 1);
const int index = line * kInventoryColumns + column;
putItem(_currentItem, index);
-
- // Remove it from our hands
- _currentItem = NULL;
+ updateInventoryCursor();
}
} else if (_vm->_mouse->rButtonPressed()) {
_vm->_mouse->rButtonSet(false);
@@ -730,6 +727,9 @@ void Game::loadItemAnimation(GameItem *item) {
}
void Game::putItem(GameItem *item, int position) {
+ // Empty our hands
+ _currentItem = NULL;
+
if (!item)
return;
assert(position >= 0);