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..

svn-id: r6311
This commit is contained in:
James Brown 2003-01-01 11:25:04 +00:00
parent be8810eaa9
commit 158951dbd9

View file

@ -1282,22 +1282,24 @@ void Scumm::drawBlastObject(BlastObject *eo)
{ {
VirtScreen *vs; VirtScreen *vs;
byte *bomp, *ptr; byte *bomp, *ptr;
int idx; int idx, objnum;
BompDrawData bdd; BompDrawData bdd;
vs = &virtscr[0]; vs = &virtscr[0];
checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d"); 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) { if (idx) {
ptr = getResourceAddress(rtFlObject, idx); ptr = getResourceAddress(rtFlObject, idx);
ptr = findResource(MKID('OBIM'), ptr); ptr = findResource(MKID('OBIM'), ptr);
} else { } else {
idx = getObjectIndex(eo->number); idx = objnum;
assert(idx != -1); ptr = getResourceAddress(rtRoom, _roomResource) + _objs[objnum].OBIMoffset;
ptr = getResourceAddress(rtRoom, _roomResource) + _objs[idx].OBIMoffset;
} }
if (!ptr) if (!ptr)
error("BlastObject object %d (%d) image not found", eo->number, idx); error("BlastObject object %d (%d) image not found", eo->number, idx);