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;
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);