[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.136,1.137
Max Horn
fingolfin at users.sourceforge.net
Sun Jul 27 18:10:18 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.135,1.136
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sound audiostream.h,1.4,1.5 audiostream.cpp,1.1,1.2 rate.cpp,1.4,1.5 rate.h,1.3,1.4 resample.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv29359
Modified Files:
object.cpp
Log Message:
more sanity checks
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- object.cpp 28 Jul 2003 00:33:05 -0000 1.136
+++ object.cpp 28 Jul 2003 01:09:54 -0000 1.137
@@ -223,7 +223,9 @@
* Returns X, Y and direction in angles
*/
void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) {
- ObjectData &od = _objs[getObjectIndex(object)];
+ int idx = getObjectIndex(object);
+ assert(idx >= 0);
+ ObjectData &od = _objs[idx];
int state;
const byte *ptr;
const ImageHeader *imhd;
@@ -993,7 +995,7 @@
}
void Scumm::addObjectToInventory(uint obj, uint room) {
- int i, slot;
+ int idx, slot;
uint32 size;
const byte *ptr;
byte *dst;
@@ -1003,8 +1005,9 @@
CHECK_HEAP
if (whereIsObject(obj) == WIO_FLOBJECT) {
- i = getObjectIndex(obj);
- ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8;
+ idx = getObjectIndex(obj);
+ assert(idx >= 0);
+ ptr = getResourceAddress(rtFlObject, _objs[idx].fl_object_index) + 8;
size = READ_BE_UINT32(ptr + 4);
} else {
findObjectInRoom(&foir, foCodeHeader, obj, room);
@@ -1399,6 +1402,7 @@
}
int idx = getObjectIndex(objectNumber);
+ assert(idx >= 0);
eo = &_blastObjectQueue[_blastObjectQueuePos++];
eo->number = objectNumber;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.135,1.136
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sound audiostream.h,1.4,1.5 audiostream.cpp,1.1,1.2 rate.cpp,1.4,1.5 rate.h,1.3,1.4 resample.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list