[Scummvm-git-logs] scummvm master -> d6912058c7dea7cc73bcc8fc3744d5cd4fe81d66

aquadran aquadran at gmail.com
Wed Aug 4 15:19:53 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

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


Commit: d6912058c7dea7cc73bcc8fc3744d5cd4fe81d66
    https://github.com/scummvm/scummvm/commit/d6912058c7dea7cc73bcc8fc3744d5cd4fe81d66
Author: Andrea Boscarino (andywinxp at gmail.com)
Date: 2021-08-04T17:19:50+02:00

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

Changed paths:
    engines/scumm/object.cpp


diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index 4cd3719b79..e094595f01 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -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);




More information about the Scummvm-git-logs mailing list