[Scummvm-git-logs] scummvm master -> 0c2d8e6e836681e09f213c29568db8e360a5204b

dreammaster noreply at scummvm.org
Sat Feb 15 19:33:11 UTC 2025


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:
0c2d8e6e83 M4: RIDDLE: Add patcher to update room 406 hotspots to game version 2.05


Commit: 0c2d8e6e836681e09f213c29568db8e360a5204b
    https://github.com/scummvm/scummvm/commit/0c2d8e6e836681e09f213c29568db8e360a5204b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-02-15T11:33:02-08:00

Commit Message:
M4: RIDDLE: Add patcher to update room 406 hotspots to game version 2.05

Changed paths:
    engines/m4/riddle/rooms/section4/room406.cpp
    engines/m4/riddle/rooms/section4/room406.h


diff --git a/engines/m4/riddle/rooms/section4/room406.cpp b/engines/m4/riddle/rooms/section4/room406.cpp
index 48940a5c2ec..5ae43814d84 100644
--- a/engines/m4/riddle/rooms/section4/room406.cpp
+++ b/engines/m4/riddle/rooms/section4/room406.cpp
@@ -47,8 +47,45 @@ static const char *const SAID[][2] = {
 	{ nullptr, nullptr }
 };
 
+struct HotspotPatch {
+	const char *_vocab;
+	const char *_verb;
+	int16 _x1;
+	int16 _y1;
+	int16 _x2;
+	int16 _y2;
+	int16 _feetX;
+	int16 _feetY;
+};
+
+static const HotspotPatch HOTSPOT_PATCHES[] = {
+	{ "BILLIARD BALL",  "LOOK AT", 204, 304, 214, 312, 180, 348 },
+	{ "SWITCH",         "LOOK AT", 419, 233, 428, 244, 400, 340 },
+	{ "ACE OF SPADES ", "LOOK AT", 412, 233, 426, 244, 400, 340 },
+	{ "ACE OF SPADES",  "LOOK AT", 412, 233, 426, 244, 400, 340 },
+	{ nullptr, nullptr, 0, 0, 0, 0, 0, 0 }
+};
+
+void Room406::patchHotspots() {
+	for (HotSpotRec *hs = _G(currentSceneDef).hotspots; hs; hs = hs->next) {
+		for (const HotspotPatch *p = HOTSPOT_PATCHES; p->_vocab; ++p) {
+			if (hs->vocab && hs->verb && !strcmp(hs->vocab, p->_vocab) &&
+					!strcmp(hs->verb, p->_verb)) {
+				hs->ul_x = p->_x1;
+				hs->ul_y = p->_y1;
+				hs->lr_x = p->_x2;
+				hs->lr_y = p->_y2;
+				hs->feet_x = p->_feetX;
+				hs->feet_y = p->_feetY;
+				break;
+			}
+		}
+	}
+}
+
 void Room406::init() {
 	player_set_commands_allowed(false);
+	patchHotspots();
 
 	switch (_G(flags)[kBilliardsTableState]) {
 	case 0:
diff --git a/engines/m4/riddle/rooms/section4/room406.h b/engines/m4/riddle/rooms/section4/room406.h
index baa52736517..03ddd9732f6 100644
--- a/engines/m4/riddle/rooms/section4/room406.h
+++ b/engines/m4/riddle/rooms/section4/room406.h
@@ -56,6 +56,7 @@ private:
 	int _deskOpening = 0;
 	int _cabinetOpens = 0;
 
+	void patchHotspots();
 	void setHotspots();
 	bool takeKeys();
 	bool takeBilliardBall();




More information about the Scummvm-git-logs mailing list