[Scummvm-git-logs] scummvm master -> 9fa9770e630b413826aadda62f692c58bd67c20d

dreammaster noreply at scummvm.org
Thu Apr 16 06:46:44 UTC 2026


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

Summary:
9fa9770e63 MM: Fix MM1 enhanced combat mouse hit detection


Commit: 9fa9770e630b413826aadda62f692c58bd67c20d
    https://github.com/scummvm/scummvm/commit/9fa9770e630b413826aadda62f692c58bd67c20d
Author: Scorp (scorp at mrs.mn)
Date: 2026-04-16T16:46:39+10:00

Commit Message:
MM: Fix MM1 enhanced combat mouse hit detection

Changed paths:
    engines/mm/mm1/views_enh/combat.cpp


diff --git a/engines/mm/mm1/views_enh/combat.cpp b/engines/mm/mm1/views_enh/combat.cpp
index 58634ab3d02..0282a696369 100644
--- a/engines/mm/mm1/views_enh/combat.cpp
+++ b/engines/mm/mm1/views_enh/combat.cpp
@@ -381,13 +381,17 @@ bool Combat::msgMouseUp(const MouseUpMessage &msg) {
 		KEYBIND_COMBAT_SHOOT, KEYBIND_COMBAT_CAST
 	};
 
+	Common::Point localPos = msg._pos;
+	localPos.x -= _innerBounds.left;
+	localPos.y -= _innerBounds.top;
+
 	if (_mode == SELECT_OPTION && _option == OPTION_NONE) {
 		// Check for option buttons being pressed
 		for (int col = 0; col < 3; ++col) {
 			for (int row = 0; row < 3; ++row) {
 				if (col != 2 || row != 2) {
 					Common::Rect r = getOptionButtonRect(col, row);
-					if (r.contains(msg._pos)) {
+					if (r.contains(localPos)) {
 						msgAction(ActionMessage(BTN_ACTIONS[col * 3 + row]));
 						return true;
 					}
@@ -399,9 +403,9 @@ bool Combat::msgMouseUp(const MouseUpMessage &msg) {
 	if (_mode == SELECT_OPTION && (_option == OPTION_SHOOT ||
 			_option == OPTION_FIGHT)) {
 		// Check for entries in the monster list being pressed
-		if (msg._pos.x >= MONSTERS_X && msg._pos.x < 310
-				&& msg._pos.y >= _innerBounds.top && msg._pos.y < 100) {
-			uint monsterNum = (msg._pos.y - _innerBounds.top) / MONSTER_H;
+		if (localPos.x >= MONSTERS_X && localPos.x < 310
+				&& localPos.y >= 0 && localPos.y < 100) {
+			uint monsterNum = localPos.y / MONSTER_H;
 			if (monsterNum < _remainingMonsters.size()) {
 				char c = 'a' + monsterNum;
 				msgKeypress(KeypressMessage(Common::KeyState(




More information about the Scummvm-git-logs mailing list