[Scummvm-cvs-logs] SF.net SVN: scummvm:[53199] scummvm/trunk/engines/toon/toon.cpp

sylvaintv at users.sourceforge.net sylvaintv at users.sourceforge.net
Wed Oct 13 00:18:43 CEST 2010


Revision: 53199
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53199&view=rev
Author:   sylvaintv
Date:     2010-10-12 22:18:43 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
TOON: Fixed bug #3086025 with bad inventory behavior

Bug #3086025 "TOON: Inventory not working correctly with butter"

Modified Paths:
--------------
    scummvm/trunk/engines/toon/toon.cpp

Modified: scummvm/trunk/engines/toon/toon.cpp
===================================================================
--- scummvm/trunk/engines/toon/toon.cpp	2010-10-12 22:18:35 UTC (rev 53198)
+++ scummvm/trunk/engines/toon/toon.cpp	2010-10-12 22:18:43 UTC (rev 53199)
@@ -1183,7 +1183,14 @@
 
 	if (_gameState->_sackVisible) {
 		if (_mouseX > 0 && _mouseX < 40 && _mouseY > 356 && _mouseY < 396) {
-			showInventory();
+			if (_gameState->_mouseState >= 0 && !rightButton) {
+				addItemToInventory(_gameState->_mouseState);
+				setCursor(0, false, 0, 0);
+				_currentHotspotItem = -1;
+				return;
+			} else {
+				showInventory();
+			}
 			return;
 		}
 	}
@@ -2320,12 +2327,18 @@
 	_inventoryPicture->loadPicture("SACK128.CPS", true);
 	_inventoryPicture->setupPalette();
 
-	if (_gameState->_mouseState >= 0)
+	if (_gameState->_mouseState >= 0) {
 		setCursor(_gameState->_mouseState, true, -18, -14);
-	else
+
+		// make sure we have a free spot
+		if (!_gameState->hasItemInInventory(0)) {
+			_gameState->_inventory[_gameState->_numInventoryItems] = 0;
+			_gameState->_numInventoryItems++;
+		}
+	} else {
 		setCursor(0);
+	}
 
-
 	_gameState->_inInventory = true;
 	_gameState->_currentScrollValue = 0;
 
@@ -2365,8 +2378,13 @@
 							if (modItem == -1) {
 								_gameState->_mouseState = item;
 								_gameState->_inventory[foundObj] = 0;
-							} else
+							} else {
 								_gameState->_mouseState = modItem;
+								if (!_gameState->hasItemInInventory(0)) {
+									_gameState->_inventory[_gameState->_numInventoryItems] = 0;
+									_gameState->_numInventoryItems++;
+								}
+							}
 
 							setCursor(_gameState->_mouseState, true, -18, -14);
 						}
@@ -3166,7 +3184,9 @@
 	case 11:
 		if (itemSrc == 0xb) {
 			_gameState->_mouseState = -1;
+			replaceItemFromInventory(11,12);
 			setCursor(0, false, 0, 0);
+			rearrangeInventory();
 			return 1;
 			//
 		} else if (itemSrc == 24) {


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