diff options
author | James Brown | 2003-01-12 08:37:59 +0000 |
---|---|---|
committer | James Brown | 2003-01-12 08:37:59 +0000 |
commit | ea9d3dd9bb3d113145a4f69939b1f8b52d34db90 (patch) | |
tree | 8c56dfc34eed76f9256994c57ba28f96a48cee09 /scumm/object.cpp | |
parent | daa5397e02d5344bb2f956ac74cf0c1d7f64737a (diff) | |
download | scummvm-rg350-ea9d3dd9bb3d113145a4f69939b1f8b52d34db90.tar.gz scummvm-rg350-ea9d3dd9bb3d113145a4f69939b1f8b52d34db90.tar.bz2 scummvm-rg350-ea9d3dd9bb3d113145a4f69939b1f8b52d34db90.zip |
Fhew. Fix crash.
svn-id: r6418
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r-- | scumm/object.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index 5953ac7cf1..6236440a52 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -320,7 +320,7 @@ void Scumm::drawRoomObjects(int arg) if (_objs[i].obj_nr > 0) drawRoomObject(i, arg); } else { - for (i = (_numLocalObjects-1); i != 0; i--) + for (i = (_numLocalObjects-1); i > 0; i--) if (_objs[i].obj_nr > 0) drawRoomObject(i, arg); } @@ -444,6 +444,12 @@ void Scumm::loadRoomObjects() else _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); + // Clear out old room objects (FIXME: Locking/FlObjects stuff?) + for (i = 0; i < _numLocalObjects; i++) { + _objs[i].obj_nr = 0; + _objs[i].fl_object_index = 0; + } + if (_numObjectsInRoom == 0) return; @@ -456,11 +462,6 @@ void Scumm::loadRoomObjects() searchptr = rootptr = room; assert(searchptr); - // Clear out old room objects (FIXME: Locking/FlObjects stuff?) - for (i = 0; i < _numLocalObjects; i++) { - _objs[i].obj_nr = 0; - _objs[i].fl_object_index = 0; - } // Load in new room objects for (i = 0; i < _numObjectsInRoom; i++) { @@ -1626,10 +1627,8 @@ int Scumm::findLocalObjectSlot() int i; for (i = 1; i < _numLocalObjects; i++) { - if (!_objs[i].obj_nr) { - printf("Returning slot %d\n", i); + if (!_objs[i].obj_nr) return i; - } } return -1; |