diff options
author | Ludvig Strigeus | 2001-12-29 13:19:53 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2001-12-29 13:19:53 +0000 |
commit | 03abddf888ccbf422b356d2cb62bf81318e2bc04 (patch) | |
tree | e41c2779a9864db5d091cecfc95ccb8f4b9fb044 | |
parent | 24bb87b24ecacd3e1ebb02339ab1f5d780c7fe4b (diff) | |
download | scummvm-rg350-03abddf888ccbf422b356d2cb62bf81318e2bc04.tar.gz scummvm-rg350-03abddf888ccbf422b356d2cb62bf81318e2bc04.tar.bz2 scummvm-rg350-03abddf888ccbf422b356d2cb62bf81318e2bc04.zip |
workaround to prevent crashes in the indy4 world map (seems to be a bug in indy4's scripts)
svn-id: r3540
-rw-r--r-- | object.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/object.cpp b/object.cpp index 2b6fcec46f..46acf689f2 100644 --- a/object.cpp +++ b/object.cpp @@ -710,6 +710,8 @@ void Scumm::setOwnerOf(int obj, int owner) { int Scumm::getObjX(int obj) { if (obj < NUM_ACTORS) { + if (obj==0) + return 0; /* fix for indy4's map */ return derefActorSafe(obj,"getObjX")->x; } else { if (whereIsObject(obj)==WIO_NOT_FOUND) @@ -721,6 +723,8 @@ int Scumm::getObjX(int obj) { int Scumm::getObjY(int obj) { if (obj < NUM_ACTORS) { + if (obj==0) + return 0; /* fix for indy4's map */ return derefActorSafe(obj,"getObjY")->y; } else { if (whereIsObject(obj)==WIO_NOT_FOUND) |