aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-12-30 11:03:13 +0000
committerJames Brown2002-12-30 11:03:13 +0000
commite2b131bbdb15ce56b1f75c58f176750601e63f7b (patch)
tree3a473dd4f27fb8c9e9995079c62b742498a99d3a
parent8acd77b85ed13493bc0b02b1a589f4f3ce404a62 (diff)
downloadscummvm-rg350-e2b131bbdb15ce56b1f75c58f176750601e63f7b.tar.gz
scummvm-rg350-e2b131bbdb15ce56b1f75c58f176750601e63f7b.tar.bz2
scummvm-rg350-e2b131bbdb15ce56b1f75c58f176750601e63f7b.zip
Implement findBlastObject correctly - inventory now works
svn-id: r6273
-rw-r--r--scumm/script_v8.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 022d03d44f..9f7e51f8f0 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1416,10 +1416,22 @@ void Scumm_v8::o6_kernelGetFunctions()
push(0);
warning("o6_kernelGetFunctions: default case %d (len = %d)", args[0], len);
break;
- case 0xD8: // findBlastObject
- // FIXME - this is WRONG and just a temporary hack
- push(findObject(args[1], args[2]));
+ case 0xD8: { // findBlastObject
+ BlastObject *eo;
+ int i;
+
+ for (i = _enqueuePos; i >= 0; i--) {
+ eo = &_enqueuedObjects[i];
+ if (eo->posX <= args[1] && eo->width + eo->posX > args[1] &&
+ eo->posY <= args[2] && eo->height + eo->posY > args[2]) {
+ push(eo->number);
+ return;
+ }
+ }
+
+ push(0);
break;
+ }
case 0xD9: // actorHit
push(0);
warning("o6_kernelGetFunctions: default case %d (len = %d)", args[0], len);