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

dreammaster noreply at scummvm.org
Mon Aug 10 11:10:57 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:
b6e79dae20 M4: RIDDLE: Fix lost walk trigger when fast-forwarding walks


Commit: b6e79dae206d507db30a795e04faf83ae51e76b3
    https://github.com/scummvm/scummvm/commit/b6e79dae206d507db30a795e04faf83ae51e76b3
Author: sloanext (46776957+sloanext at users.noreply.github.com)
Date: 2026-08-10T21:10:52+10:00

Commit Message:
M4: RIDDLE: Fix lost walk trigger when fast-forwarding walks

The walker script's DEMAND_FACING/DEMAND_LOCATION handlers reset the
walker status before re-entering the idle state, so the callback that
follows a hyperwalk jump carried trigger type 0, which the walker
callback ignores. Any walk started by room code with a completion
trigger (e.g. the room 701 / Sikkim Posh Express office exit) would
therefore soft-lock when fast-forwarded by pressing space.

The walker script has a dedicated hyperwalk handler, message 747,
registered in all of its walking states: it moves the walker to the
destination, sets the final facing, and finishes with the type 3
"walk finished" callback that dispatches the stored trigger. Route
hyperwalk through it.

Changed paths:
    engines/m4/adv_r/adv_walk.cpp
    engines/m4/wscript/ws_machine.h


diff --git a/engines/m4/adv_r/adv_walk.cpp b/engines/m4/adv_r/adv_walk.cpp
index 2ad20eb333b..4c16aff3894 100644
--- a/engines/m4/adv_r/adv_walk.cpp
+++ b/engines/m4/adv_r/adv_walk.cpp
@@ -26,6 +26,7 @@
 #include "m4/graphics/gr_series.h"
 #include "m4/wscript/wst_regs.h"
 #include "m4/vars.h"
+#include "m4/m4.h"
 
 namespace M4 {
 
@@ -446,8 +447,29 @@ void adv_hyperwalk_to_final_destination(void *, void *) {
 	DisposePath(_G(my_walker)->walkPath);
 	_G(my_walker)->walkPath = nullptr;
 
-	// This will make player goto x,y,facing. when that happens, trigger will return
-	ws_demand_location_and_facing(_G(my_walker), x, y, facing);
+	if (IS_RIDDLE) {
+		// WORKAROUND: Riddle's walker script has a dedicated hyperwalk
+		// handler (message 747), registered in all of its walking states.
+		// It moves the walker to x, y, s, sets the final facing, and ends
+		// with the "walk finished" callback, which dispatches the trigger
+		// registered when the walk started. The DEMAND_LOCATION path below
+		// never issues that callback, so a scripted walk (e.g. a room exit
+		// waiting on a walk-completion trigger) would soft-lock when
+		// fast-forwarded.
+		const int8 directions[14] = { 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 9 };
+		const frac16 s = _G(globals)[GLB_MIN_SCALE] + FixedMul((y << 16) - _G(globals)[GLB_MIN_Y], _G(globals)[GLB_SCALER]);
+
+		_G(globals)[GLB_TEMP_1] = x << 16;
+		_G(globals)[GLB_TEMP_2] = y << 16;
+		_G(globals)[GLB_TEMP_3] = s;
+		_G(globals)[GLB_TEMP_4] = (facing > 0 && facing < 13) ? directions[facing] << 16 : 0;
+
+		sendWSMessage(HYPERWALK << 16, 0, _G(my_walker), 0, nullptr, 1);
+		_G(player).waiting_for_walk = false;
+	} else {
+		// This will make player goto x,y,facing. when that happens, trigger will return
+		ws_demand_location_and_facing(_G(my_walker), x, y, facing);
+	}
 }
 
 } // End of namespace M4
diff --git a/engines/m4/wscript/ws_machine.h b/engines/m4/wscript/ws_machine.h
index a8aaa3dd8b1..e0ad6f7bbef 100644
--- a/engines/m4/wscript/ws_machine.h
+++ b/engines/m4/wscript/ws_machine.h
@@ -65,6 +65,7 @@ enum {
 	ACTION_32 = 32,
 	ACTION_33 = 33,
 	ACTION_666 = 666,
+	HYPERWALK = 747,
 	ACTION_900 = 900,
 	ACTION_902 = 902
 };




More information about the Scummvm-git-logs mailing list