diff options
author | Robert Špalek | 2009-11-22 20:25:27 +0000 |
---|---|---|
committer | Robert Špalek | 2009-11-22 20:25:27 +0000 |
commit | 772b89682d7ae314d1b776f6c47ab10ac6d865cb (patch) | |
tree | 1a05d763c1c937d205150d8bd459f82941f58fed /engines/draci | |
parent | 00063b142303483cfea7fc2522ac45daaa7025f4 (diff) | |
download | scummvm-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/draci')
-rw-r--r-- | engines/draci/game.cpp | 8 |
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); |