aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-03-15 10:55:32 +0000
committerJohannes Schickel2008-03-15 10:55:32 +0000
commit850868536b3c4ccac2ccaaa26c4380b47093f209 (patch)
tree09f93eab955f19d17acb41ed2bc3e2f912617922 /engines
parent91adba9842b516cbe02966f0d140aa2d7f5dc79c (diff)
downloadscummvm-rg350-850868536b3c4ccac2ccaaa26c4380b47093f209.tar.gz
scummvm-rg350-850868536b3c4ccac2ccaaa26c4380b47093f209.tar.bz2
scummvm-rg350-850868536b3c4ccac2ccaaa26c4380b47093f209.zip
Fixed bug in o2_countItemInInventory.
svn-id: r31126
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/script_v2.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index 6f8f2962e8..0fe07ab93a 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -274,8 +274,8 @@ int KyraEngine_v2::o2_defineItem(ScriptState *script) {
}
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 @@ int KyraEngine_v2::o2_countItemInInventory(ScriptState *script) {
++count;
}
- if (_itemInHand == int16(item))
+ if ((stackPos(0) == 0) && _itemInHand == int16(item))
++count;
return count;