SCUMM: Fix findObject(x,y) for DIG and COMI

This commit is contained in:
Andrea Boscarino 2021-08-02 19:40:16 +02:00 committed by Paweł Kołodziejski
parent 064a266a22
commit d6912058c7

View file

@ -540,9 +540,15 @@ int ScummEngine::findObject(int x, int y) {
return _objs[i].obj_nr;
}
#endif
if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x &&
_objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y)
return _objs[i].obj_nr;
if (_game.id == GID_CMI || _game.id == GID_DIG) {
if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos >= x &&
_objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos >= y)
return _objs[i].obj_nr;
} else {
if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x &&
_objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y)
return _objs[i].obj_nr;
}
break;
}
} while ((_objs[b].state & mask) == a);