aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorColin Snover2017-11-30 20:09:24 -0600
committerColin Snover2017-12-01 19:22:52 -0600
commit5cd2c9a387537a7eb006eabed831126c4034c8f8 (patch)
tree4301b4353a93e9e49153e5c2c4ed406e3c2e7670 /engines/scumm
parent57084b4a1b23e131be7497c4c97c75db060210c9 (diff)
downloadscummvm-rg350-5cd2c9a387537a7eb006eabed831126c4034c8f8.tar.gz
scummvm-rg350-5cd2c9a387537a7eb006eabed831126c4034c8f8.tar.bz2
scummvm-rg350-5cd2c9a387537a7eb006eabed831126c4034c8f8.zip
SCUMM: Fix possible return of garbage values
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/object.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index cbc24a8b7e..f4aea93b8b 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -1538,7 +1538,8 @@ int ScummEngine::getObjX(int obj) {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return -1;
int x, y;
- getObjectOrActorXY(obj, x, y);
+ if (getObjectOrActorXY(obj, x, y) == -1)
+ return -1;
return x;
}
}
@@ -1553,7 +1554,8 @@ int ScummEngine::getObjY(int obj) {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return -1;
int x, y;
- getObjectOrActorXY(obj, x, y);
+ if (getObjectOrActorXY(obj, x, y) == -1)
+ return -1;
return y;
}
}