[Scummvm-git-logs] scummvm master -> 2c2feff7dd4f47551e167e9e31187dce98ac19b2

OMGPizzaGuy noreply at scummvm.org
Sat Jan 13 04:16:28 UTC 2024


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:
2c2feff7dd ULTIMA8: Fix bounds check for set mouse coordinates


Commit: 2c2feff7dd4f47551e167e9e31187dce98ac19b2
    https://github.com/scummvm/scummvm/commit/2c2feff7dd4f47551e167e9e31187dce98ac19b2
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-12T22:16:06-06:00

Commit Message:
ULTIMA8: Fix bounds check for set mouse coordinates
Fixes #14838

Changed paths:
    engines/ultima/ultima8/kernel/mouse.cpp


diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index e7ab098dd5b..708da926363 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -275,13 +275,13 @@ void Mouse::setMouseCoords(int mx, int my) {
 
 	if (mx < dims.left)
 		mx = dims.left;
-	else if (mx > dims.width())
-		mx = dims.width();
+	else if (mx >= dims.right)
+		mx = dims.right - 1;
 
 	if (my < dims.top)
 		my = dims.top;
-	else if (my > dims.height())
-		my = dims.height();
+	else if (my >= dims.bottom)
+		my = dims.bottom - 1;
 
 	_mousePos.x = mx;
 	_mousePos.y = my;




More information about the Scummvm-git-logs mailing list