From 5cd2c9a387537a7eb006eabed831126c4034c8f8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 30 Nov 2017 20:09:24 -0600 Subject: SCUMM: Fix possible return of garbage values --- engines/scumm/object.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines') 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; } } -- cgit v1.2.3