[Scummvm-cvs-logs] SF.net SVN: scummvm:[46096] scummvm/trunk/engines/draci/game.cpp

spalek at users.sourceforge.net spalek at users.sourceforge.net
Sun Nov 22 21:25:27 CET 2009


Revision: 46096
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46096&view=rev
Author:   spalek
Date:     2009-11-22 20:25:27 +0000 (Sun, 22 Nov 2009)

Log Message:
-----------
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().

Modified Paths:
--------------
    scummvm/trunk/engines/draci/game.cpp

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-11-22 20:17:39 UTC (rev 46095)
+++ scummvm/trunk/engines/draci/game.cpp	2009-11-22 20:25:27 UTC (rev 46096)
@@ -249,7 +249,6 @@
 
 		if (_currentItem) {
 			putItem(_currentItem, 0);
-			_currentItem = NULL;
 			updateOrdinaryCursor();
 		} else {
 			if (_objUnderCursor) {
@@ -341,9 +340,7 @@
 				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::putItem(GameItem *item, int position) {
+	// Empty our hands
+	_currentItem = NULL;
+
 	if (!item)
 		return;
 	assert(position >= 0);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list