[Scummvm-cvs-logs] SF.net SVN: scummvm: [31126] scummvm/trunk/engines/kyra/script_v2.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Mar 15 11:55:33 CET 2008


Revision: 31126
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31126&view=rev
Author:   lordhoto
Date:     2008-03-15 03:55:32 -0700 (Sat, 15 Mar 2008)

Log Message:
-----------
Fixed bug in o2_countItemInInventory.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-15 09:57:41 UTC (rev 31125)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-15 10:55:32 UTC (rev 31126)
@@ -274,8 +274,8 @@
 }
 
 int KyraEngine_v2::o2_countItemInInventory(ScriptState *script) {
-	debugC(3, kDebugLevelScriptFuncs, "o2_countItemInInventory(%p) (%d)", (const void *)script, stackPos(0));
-	uint16 item = stackPos(0);
+	debugC(3, kDebugLevelScriptFuncs, "o2_countItemInInventory(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	uint16 item = stackPos(1);
 	int count = 0;
 
 	for (int i = 0; i < 20; ++i) {
@@ -283,7 +283,7 @@
 			++count;
 	}
 
-	if (_itemInHand == int16(item))
+	if ((stackPos(0) == 0) && _itemInHand == int16(item))
 		++count;
 
 	return count;


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