aboutsummaryrefslogtreecommitdiff
path: root/scumm/object.cpp
diff options
context:
space:
mode:
authorMax Horn2003-03-08 00:56:43 +0000
committerMax Horn2003-03-08 00:56:43 +0000
commitc7399601760e8658ed0ae52acdda980c29550db3 (patch)
tree4afe097877f4a87e94204cb95c2e4a68e1c7b2ab /scumm/object.cpp
parent20c6cfdd2dbd06c4a7f2249405c02604c99e3fc1 (diff)
downloadscummvm-rg350-c7399601760e8658ed0ae52acdda980c29550db3.tar.gz
scummvm-rg350-c7399601760e8658ed0ae52acdda980c29550db3.tar.bz2
scummvm-rg350-c7399601760e8658ed0ae52acdda980c29550db3.zip
added yet another sanity check (assert); fixed long standing evil bug in getObjNewDir / getObjOldDir
svn-id: r6763
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r--scumm/object.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 81ab29d1de..e61a309785 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1068,31 +1068,16 @@ int Scumm::getObjY(int obj) {
}
int Scumm::getObjOldDir(int obj) {
- if (obj < NUM_ACTORS) {
- return newDirToOldDir(derefActorSafe(obj, "getObjOldDir")->facing);
- } else {
- int x, y, dir;
- getObjectXYPos(obj, x, y, dir);
- return dir;
- }
+ return newDirToOldDir(getObjNewDir(obj));
}
-int another_dummy_valgrind_var = 0;
-
int Scumm::getObjNewDir(int obj) {
int dir;
if (obj < NUM_ACTORS) {
dir = derefActorSafe(obj, "getObjNewDir")->facing;
- if (dir > 0)
- another_dummy_valgrind_var++;
} else {
int x, y;
getObjectXYPos(obj, x, y, dir);
- if (dir > 0)
- another_dummy_valgrind_var *= 2;
- dir = oldDirToNewDir(dir);
- if (dir > 0)
- another_dummy_valgrind_var--;
}
return dir;
}