aboutsummaryrefslogtreecommitdiff
path: root/scumm/object.cpp
diff options
context:
space:
mode:
authorJames Brown2003-01-01 11:25:04 +0000
committerJames Brown2003-01-01 11:25:04 +0000
commit158951dbd962faa9e7ee13acbceb1c4291156c53 (patch)
tree9a0442c5f7100eda7aace3c04186c85105dad5dd /scumm/object.cpp
parentbe8810eaa90149c8df9a1d10ce3028e1c6c4bd7e (diff)
downloadscummvm-rg350-158951dbd962faa9e7ee13acbceb1c4291156c53.tar.gz
scummvm-rg350-158951dbd962faa9e7ee13acbceb1c4291156c53.tar.bz2
scummvm-rg350-158951dbd962faa9e7ee13acbceb1c4291156c53.zip
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
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r--scumm/object.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index ea2caafdf5..b685f68ef6 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -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);