aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-07-28 00:04:20 +0000
committerMax Horn2003-07-28 00:04:20 +0000
commit0d209fecb654e0302283295a3e020940c8c368c5 (patch)
tree02aaabd371d2e096acd62b2d4e22a9ded4784f64 /scumm
parentff988094be7b5c3c96c7b304bec7c2439a8cccf4 (diff)
downloadscummvm-rg350-0d209fecb654e0302283295a3e020940c8c368c5.tar.gz
scummvm-rg350-0d209fecb654e0302283295a3e020940c8c368c5.tar.bz2
scummvm-rg350-0d209fecb654e0302283295a3e020940c8c368c5.zip
fix return values in getObjectOrActorXY; turned unsafe derefActorSafe call into derefActor (return value of derefActorSafe was used w/o checking it for 0)
svn-id: r9206
Diffstat (limited to 'scumm')
-rw-r--r--scumm/object.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 21044fdbe4..db1369545e 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -199,10 +199,10 @@ int Scumm::whereIsObject(int object) const {
int Scumm::getObjectOrActorXY(int object, int &x, int &y) {
if (object < _numActors) {
Actor *act = derefActorSafe(object, "getObjectOrActorXY");
- if (!act)
- return 0;
- else
+ if (act)
return act->getActorXYPos(x, y);
+ else
+ return -1;
}
switch (whereIsObject(object)) {
@@ -210,9 +210,9 @@ int Scumm::getObjectOrActorXY(int object, int &x, int &y) {
return -1;
case WIO_INVENTORY:
if (_objectOwnerTable[object] < _numActors)
- return derefActorSafe(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y);
+ return derefActor(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y);
else
- return 0xFF;
+ return -1;
}
getObjectXYPos(object, x, y);
return 0;
@@ -461,7 +461,7 @@ void Scumm::clearRoomObjects() {
nukeResource(rtFlObject, _objs[i].fl_object_index);
_objs[i].obj_nr = 0;
_objs[i].fl_object_index = 0;
- }
+ }
}
}
}