[Scummvm-cvs-logs] CVS: scummvm/scumm script_v8.cpp,2.81,2.82

James Brown ender at users.sourceforge.net
Mon Dec 30 03:04:02 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv3882/scumm

Modified Files:
	script_v8.cpp 
Log Message:
Implement findBlastObject correctly - inventory now works


Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.81
retrieving revision 2.82
diff -u -d -r2.81 -r2.82
--- script_v8.cpp	30 Dec 2002 01:40:11 -0000	2.81
+++ script_v8.cpp	30 Dec 2002 11:03:13 -0000	2.82
@@ -1416,10 +1416,22 @@
 		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);





More information about the Scummvm-git-logs mailing list