mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
SCUMM: Fix possible return of garbage values
This commit is contained in:
parent
57084b4a1b
commit
5cd2c9a387
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user