From 772b89682d7ae314d1b776f6c47ab10ac6d865cb Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sun, 22 Nov 2009 20:25:27 +0000 Subject: 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 --- engines/draci/game.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/draci') 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); -- cgit v1.2.3