[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.40,1.41

James Brown ender at users.sourceforge.net
Wed Jan 1 03:26:02 CET 2003


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

Modified Files:
	object.cpp 
Log Message:
Clean up the code a little.
For some reason blast objects 188/189 are misbehaving, specifically you get a crash when talking to the voodoo lady. hit escape using 
this save: http://www.enderboi.com/misc/comi.s04 - I can't work out how the heck an association is created to begin with..



Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- object.cpp	31 Dec 2002 03:32:05 -0000	1.40
+++ object.cpp	1 Jan 2003 11:25:04 -0000	1.41
@@ -1282,22 +1282,24 @@
 {
 	VirtScreen *vs;
 	byte *bomp, *ptr;
-	int idx;
+	int idx, objnum;
 	BompDrawData bdd;
 
 	vs = &virtscr[0];
 
 	checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d");
 
-	idx = _objs[getObjectIndex(eo->number)].fl_object_index;
+	objnum = getObjectIndex(eo->number);
+	if (objnum == -1)
+		error("drawBlastObject: getObjectIndex on BlastObject %d failed", eo->number);
 
+	idx = _objs[objnum].fl_object_index;
 	if (idx) {
 		ptr = getResourceAddress(rtFlObject, idx);
 		ptr = findResource(MKID('OBIM'), ptr);
 	} else {
-		idx = getObjectIndex(eo->number);
-		assert(idx != -1);
-		ptr = getResourceAddress(rtRoom, _roomResource) + _objs[idx].OBIMoffset;
+		idx = objnum;
+		ptr = getResourceAddress(rtRoom, _roomResource) + _objs[objnum].OBIMoffset;
 	}
 	if (!ptr)
 		error("BlastObject object %d (%d) image not found", eo->number, idx);





More information about the Scummvm-git-logs mailing list