[Scummvm-git-logs] scummvm master -> 674e7b0dd18359fc70f255272e8a16d93aa24bc7

dreammaster noreply at scummvm.org
Sun Nov 10 01:23:54 UTC 2024


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

Summary:
cfa0975007 M4: RIDDLE: Fixes for game over stealing from peasant
674e7b0dd1 M4: RIDDLE: Fix restoring autosave to undo death


Commit: cfa09750076ef2c39d117bc956e04c1e8f00dbbe
    https://github.com/scummvm/scummvm/commit/cfa09750076ef2c39d117bc956e04c1e8f00dbbe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-11-09T17:23:41-08:00

Commit Message:
M4: RIDDLE: Fixes for game over stealing from peasant

Changed paths:
    engines/m4/riddle/rooms/section2/room203.cpp
    engines/m4/riddle/rooms/section2/room203.h
    engines/m4/riddle/rooms/section2/room207.cpp
    engines/m4/riddle/rooms/section2/room207.h
    engines/m4/riddle/rooms/section4/room413.cpp


diff --git a/engines/m4/riddle/rooms/section2/room203.cpp b/engines/m4/riddle/rooms/section2/room203.cpp
index 10b633aeb05..dbfcbe078ce 100644
--- a/engines/m4/riddle/rooms/section2/room203.cpp
+++ b/engines/m4/riddle/rooms/section2/room203.cpp
@@ -215,7 +215,7 @@ void Room203::init() {
 				_peasantRocksShadow, 1, 1, 0);
 
 			digi_preload("203p02");
-			_flag1 = true;
+			_yellThiefFlag = true;
 			_officialMode = 2001;
 			_officialShould = 2010;
 
@@ -762,13 +762,13 @@ void Room203::daemon() {
 			_peskyYellsThief, 19, 19, 0);
 		sendWSMessage_10000(1, _peasantShadow, _peasantRocksShadow, 1, 1, -1,
 			_peasantRocksShadow, 1, 1, 0);
-		_flag1 = true;
+		_yellThiefFlag = true;
 		kernel_timing_trigger(100, 92);
 		digi_preload("203p02");
 		break;
 
 	case 92:
-		if (_flag1)
+		if (_yellThiefFlag)
 			digi_play("203p02", 1, 255, 93);
 		else
 			digi_unload("203p02");
@@ -779,7 +779,7 @@ void Room203::daemon() {
 		break;
 
 	case 94:
-		if (_flag1) {
+		if (_yellThiefFlag) {
 			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 19, 21, 95,
 				_peskyYellsThief, 21, 21, 0);
 		} else {
@@ -789,7 +789,7 @@ void Room203::daemon() {
 		break;
 
 	case 95:
-		if (_flag1) {
+		if (_yellThiefFlag) {
 			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 21, 19, 94,
 				_peskyYellsThief, 19, 19, 0);
 		} else {
@@ -823,7 +823,7 @@ void Room203::daemon() {
 		break;
 
 	case 99:
-		_flag1 = false;
+		_yellThiefFlag = false;
 		_officialTurn9_11_pointGun = series_load("official turn 9-11 point gun");
 		setGlobals1(_officialTurn9_11_pointGun, 1, 31, 31, 31, 0, 31, 13, 13, 13, 0, 13, 1, 1, 1);
 		sendWSMessage_110000(_official, 100);
@@ -2314,7 +2314,7 @@ void Room203::daemon() {
 		break;
 
 	case 352:
-		if (_flag1)
+		if (_yellThiefFlag)
 			digi_play("203p02", 1, 255, 93);
 		else
 			digi_unload("203p02");
@@ -2325,7 +2325,7 @@ void Room203::daemon() {
 		break;
 
 	case 354:
-		if (_flag1) {
+		if (_yellThiefFlag) {
 			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 17, 21, 355,
 				_peskyYellsThief, 21, 21, 0);
 		} else {
@@ -2335,12 +2335,12 @@ void Room203::daemon() {
 		break;
 
 	case 355:
-		if (_flag1) {
-			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 21, 1, -1,
-				_peskyYellsThief, 1, 1, 0);
-		} else {
+		if (_yellThiefFlag) {
 			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 21, 17, 354,
 				_peskyYellsThief, 17, 17, 0);
+		} else {
+			sendWSMessage_10000(1, _peasant, _peskyYellsThief, 21, 1, -1,
+				_peskyYellsThief, 1, 1, 0);
 		}
 		break;
 
@@ -2349,10 +2349,11 @@ void Room203::daemon() {
 		_official = triggerMachineByHash_3000(8, 5, *OFFICIAL_NORMAL_DIRS,
 			*OFFICIAL_SHADOW_DIRS, 1436, 362, 9, triggerMachineByHashCallback3000,
 			"official arresting");
+		sendWSMessage_10000(_official, 1065, 355, 9, 357, 1);
 		break;
 
 	case 357:
-		_flag1 = false;
+		_yellThiefFlag = false;
 		setGlobals1(_officialTurn9_11, 1, 19, 19, 19);
 		sendWSMessage_110000(_official, 358);
 		break;
@@ -2375,7 +2376,7 @@ void Room203::daemon() {
 
 	case 363:
 		ws_demand_location(1100, 290, 9);
-		ws_walk(1060, 290, nullptr, 36, 7);
+		ws_walk(1060, 290, nullptr, 364, 7);
 		break;
 
 	case 364:
diff --git a/engines/m4/riddle/rooms/section2/room203.h b/engines/m4/riddle/rooms/section2/room203.h
index 28fb309b690..057613464d7 100644
--- a/engines/m4/riddle/rooms/section2/room203.h
+++ b/engines/m4/riddle/rooms/section2/room203.h
@@ -127,7 +127,7 @@ private:
 	int _peasantSquat3 = 0;
 	int _peasantSquatTo9 = 0;
 	int _peasantFromSquat3 = 0;
-	bool _flag1 = false;
+	bool _yellThiefFlag = false;
 	bool _flag2 = false;
 	machine *_sg = nullptr;
 	int _203sg01 = 0;
diff --git a/engines/m4/riddle/rooms/section2/room207.cpp b/engines/m4/riddle/rooms/section2/room207.cpp
index 26e04445a37..ee46c9efbe6 100644
--- a/engines/m4/riddle/rooms/section2/room207.cpp
+++ b/engines/m4/riddle/rooms/section2/room207.cpp
@@ -148,8 +148,8 @@ void Room207::init() {
 					_peskyPointsRipForegroundSeries, 19, 19, 0);
 			} else if (inv_player_has("METAL RIM")) {
 				_peskyPointsRipBackgroundSeries = series_load("pesky points at rip background", -1, nullptr);
-				sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipBackgroundSeries,
-					19, 19, 100, _peskyPointsRipBackgroundSeries, 19, 19, 0);
+				sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipBackgroundSeries, 19, 19, 100,
+					_peskyPointsRipBackgroundSeries, 19, 19, 0);
 			} else {
 				sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 20, 101,
 					_peskyRockLoopSeries, 20, 20, 0);
@@ -294,10 +294,10 @@ void Room207::parser() {
 		player_set_commands_allowed(false);
 
 		if (!_node1Entry2Fl) {
-			_field92 = 0;
+			_peasantShould = 0;
 			_fieldC2 = 3;
 		} else {
-			_field92 = 6;
+			_peasantShould = 6;
 			_commandNotAllowedFl = true;
 		}
 	} // if (_G(kernel).trigger == 747)
@@ -318,7 +318,7 @@ void Room207::parser() {
 		_fieldC6 = false;
 		_fieldC2 = 1;
 		sendWSMessage_10000(1, _ripInConvMach, _ripTrekArmsXPos3Series, 1, 15, 23, _ripTrekArmsXPos3Series, 15, 15, 0);
-		_field92 = 13;
+		_peasantShould = 13;
 	} // if (talkFl && player_said("peasant"))
 
 	else if (player_said("handout")) {
@@ -330,7 +330,7 @@ void Room207::parser() {
 			break;
 
 		case 2:
-			_field92 = 16;
+			_peasantShould = 16;
 			_ripTrekLowReacherPos1Series = series_load("rip trek low reacher pos1", -1, nullptr);
 
 			break;
@@ -345,7 +345,7 @@ void Room207::parser() {
 
 		case 4:
 			series_ranged_play_xy("rip trek low reacher pos1", 1, 2, 0, 9, _G(player_info).x, _G(player_info).y, _G(player_info).scale, 512, 6, 6, false);
-			_field92 = 0;
+			_peasantShould = 0;
 
 			break;
 
@@ -458,7 +458,7 @@ void Room207::parser() {
 			case 3:
 				player_update_info();
 				_ripTrekLowReachMach = series_ranged_play_xy("rip trek med reach pos3", -1, 2, 10, 10, _G(player_info).x, _G(player_info).y, _G(player_info).scale, 512, 300, -1, false);
-				_field92 = 7;
+				_peasantShould = 7;
 
 				break;
 
@@ -500,7 +500,7 @@ void Room207::parser() {
 			case 3:
 				player_update_info();
 				_ripTrekLowReachMach = series_ranged_play_xy("rip trek med reach pos3", -1, 2, 10, 10, _G(player_info).x, _G(player_info).y, _G(player_info).scale, 512, 300, -1, false);
-				_field92 = 9;
+				_peasantShould = 9;
 
 				break;
 
@@ -720,11 +720,11 @@ void Room207::parser() {
 
 				if (!_pipeFlag) {
 					hotspot_set_active(_G(currentSceneDef).hotspots, "PEASANT", false);
-					_field92 = 3;
+					_peasantShould = 3;
 					_digiName = "207p01";
 					_digiTriggerNum = 6;
 				} else {
-					_field92 = 3;
+					_peasantShould = 3;
 					_digiName = "207p01a";
 					_digiTriggerNum = 7;
 				}
@@ -732,7 +732,7 @@ void Room207::parser() {
 				break;
 
 			case 6:
-				_field92 = 2;
+				_peasantShould = 2;
 				player_set_commands_allowed(true);
 				_fieldB6_counter = 0;
 				_fieldB2 = true;
@@ -742,7 +742,7 @@ void Room207::parser() {
 
 			case 7:
 				_pipeFlag = false;
-				_field92 = 0;
+				_peasantShould = 0;
 				_commandNotAllowedFl = true;
 				_G(flags[V043]) = 1;
 				break;
@@ -806,7 +806,7 @@ void Room207::parser() {
 				series_unload(_ripTrekLowReacherPos1Series);
 
 				if (_pipeFlag) {
-					_field92 = 3;
+					_peasantShould = 3;
 					_digiName = "207p01a";
 					_digiTriggerNum = 5;
 					_nextTriggerMode = KT_PARSE;
@@ -814,7 +814,7 @@ void Room207::parser() {
 					player_set_commands_allowed(true);
 				} else {
 					hotspot_set_active(_G(currentSceneDef).hotspots, "PEASANT", false);
-					_field92 = 3;
+					_peasantShould = 3;
 					_digiName = "207p01";
 					_digiTriggerNum = 4;
 					_nextTriggerMode = KT_PARSE;
@@ -823,7 +823,7 @@ void Room207::parser() {
 
 			case 4:
 				hotspot_set_active(_G(currentSceneDef).hotspots, "METAL RIM", false);
-				_field92 = 2;
+				_peasantShould = 2;
 				player_set_commands_allowed(true);
 				_fieldB6_counter = 0;
 				_fieldB2 = true;
@@ -834,7 +834,7 @@ void Room207::parser() {
 
 			case 5:
 				_pipeFlag = false;
-				_field92 = 0;
+				_peasantShould = 0;
 				_commandNotAllowedFl = true;
 				_G(flags[V043]) = 1;
 
@@ -940,7 +940,7 @@ void Room207::parser() {
 
 				case 4:
 					sendWSMessage_10000(1, _ripTrekLowReachMach, _ripHeadDownTalkOffTd33Series2, 3, 3, -1, _ripHeadDownTalkOffTd33Series2, 3, 3, 1);
-					_field92 = 6;
+					_peasantShould = 6;
 
 					break;
 
@@ -1148,8 +1148,8 @@ void Room207::daemon() {
 		sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 20, 101,
 			_peskyRockLoopSeries, 20, 20, 0);
 		player_set_commands_allowed(true);
-		_field8E = 0;
-		_field92 = 0;
+		_peasantMode = 0;
+		_peasantShould = 0;
 
 		break;
 
@@ -1256,7 +1256,7 @@ void Room207::daemon() {
 		break;
 
 	case 100:
-		if (_field8E != 0 || _field92 != 0 || _dispatchTriggerNum == -1) {
+		if (_peasantMode != 0 || _peasantShould != 0 || _dispatchTriggerNum == -1) {
 			kernel_trigger_dispatchx(kernel_trigger_create(101));
 			break;
 		}
@@ -1273,9 +1273,9 @@ void Room207::daemon() {
 		break;
 
 	case 101:
-		switch (_field8E) {
+		switch (_peasantMode) {
 		case 2:
-			if (_field92 == 2) {
+			if (_peasantShould == 2) {
 				if (_commandNotAllowedFl) {
 					_commandNotAllowedFl =false;
 					player_set_commands_allowed(true);
@@ -1324,24 +1324,24 @@ void Room207::daemon() {
 					}
 				}
 
-			} else if (_field92 == 3) {
+			} else if (_peasantShould == 3) {
 				if (_ripForegroundFl)
 					sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipForegroundSeries, 17, 17, 100, _peskyPointsRipForegroundSeries, 17, 17, 1);
 				else
 					sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipBackgroundSeries, 17, 17, 100, _peskyPointsRipBackgroundSeries, 17, 17, 1);
-				_field8E = 3;
+				_peasantMode = 3;
 			} else { // _field92 != 2 && _field92 != 3
 				if (_ripForegroundFl)
 					sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipForegroundSeries, 18, 1, 115, _peskyRockLoopSeries, 1, 1, 0);
 				else
 					sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipBackgroundSeries, 18, 1, 118, _peskyRockLoopSeries, 1, 1, 0);
 
-				_field8E = 0;
+				_peasantMode = 0;
 				hotspot_set_active(_G(currentSceneDef).hotspots, "PEASANT", true);
 			}
 			break;
 		case 3:
-			if (_field92 == 3) {
+			if (_peasantShould == 3) {
 				if (_digiName) {
 					_G(kernel).trigger_mode = _nextTriggerMode;
 					digi_play(_digiName, 1, 255, _digiTriggerNum, 203);
@@ -1366,13 +1366,13 @@ void Room207::daemon() {
 				} else {
 					sendWSMessage_10000(1, _ppSquatMach, _peskyPointsRipBackgroundSeries, 17, 17, 100, _peskyPointsRipBackgroundSeries, 17, 17, 1);
 				}
-				_field8E = 2;
+				_peasantMode = 2;
 			}
 
 			break;
 
 		case 6:
-			if (_field92 == 6) {
+			if (_peasantShould == 6) {
 				if (_digi207r04PlayedFl) {
 					if (inv_player_has("REBUS AMULET")) {
 						sendWSMessage_10000(1, _ppSquatMach, _withoutAmuletSeries, 52, 1, 104, _withoutAmuletSeries, 1, 1, 0);
@@ -1390,20 +1390,20 @@ void Room207::daemon() {
 					sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 52, 1, 100, _ppShowsAmuletTakesMoneySeries, 1, 1, 1);
 				}
 
-				_field8E = 0;
+				_peasantMode = 0;
 			}
 
 			break;
 
 		case 7:
-			if (_field92 == 7) {
+			if (_peasantShould == 7) {
 				if (inv_player_has("REBUS AMULET")) {
 					sendWSMessage_10000(1, _ppSquatMach, _withoutAmuletSeries, 52, 52, -1, _withoutAmuletSeries, 52, 52, 0);
 				} else {
 					sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 52, 52, -1, _ppShowsAmuletTakesMoneySeries, 52, 52, 0);
 				}
 
-				_field8E = 8;
+				_peasantMode = 8;
 				inv_give_to_player("REBUS AMULET");
 				hotspot_set_active(_G(currentSceneDef).hotspots, "REBUS AMULET", false);
 				kernel_examine_inventory_object("ping rebus amulet", _G(master_palette), 5, 1, 329, 250, 103, nullptr, -1);
@@ -1412,7 +1412,7 @@ void Room207::daemon() {
 			break;
 
 		case 8:
-			if (_field92 == 8) {
+			if (_peasantShould == 8) {
 				if (inv_player_has("REBUS AMULET")) {
 					sendWSMessage_10000(1, _ppSquatMach, _withoutAmuletSeries, 52, 52, 100, _withoutAmuletSeries, 52, 52, 0);
 				} else {
@@ -1422,7 +1422,7 @@ void Room207::daemon() {
 
 			break;
 		case 9:
-			if (_field92 == 9) {
+			if (_peasantShould == 9) {
 				if (inv_player_has("REBUS AMULET")) {
 					sendWSMessage_10000(1, _ppSquatMach, _withoutAmuletSeries, 16, 16, -1, _withoutAmuletSeries, 16, 16, 0);
 				} else {
@@ -1430,7 +1430,7 @@ void Room207::daemon() {
 				}
 
 				kernel_timing_trigger(60, 100, nullptr);
-				_field8E = 10;
+				_peasantMode = 10;
 			}
 
 			break;
@@ -1438,10 +1438,10 @@ void Room207::daemon() {
 		case 10:
 			if (inv_player_has("REBUS AMULET")) {
 				sendWSMessage_10000(1, _ppSquatMach, _withoutAmuletSeries, 16, 1, 100, _withoutAmuletSeries, 1, 1, 0);
-				_field8E = 11;
+				_peasantMode = 11;
 			} else {
 				sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 16, 1, 100, _ppShowsAmuletTakesMoneySeries, 1, 1, 0);
-				_field8E = 11;
+				_peasantMode = 11;
 			}
 
 			break;
@@ -1452,8 +1452,8 @@ void Room207::daemon() {
 			sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 1, 100, _peskyRockLoopSeries, 1, 1, 0);
 			_G(kernel).trigger_mode = KT_PARSE;
 			kernel_timing_trigger(1, 4, nullptr);
-			_field8E = 0;
-			_field92 = 0;
+			_peasantMode = 0;
+			_peasantShould = 0;
 
 			break;
 
@@ -1465,12 +1465,12 @@ void Room207::daemon() {
 
 			sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 1, 100, _peskyRockLoopSeries, 1, 1, 0);
 
-			_field8E = 0;
-			_field92 = 0;
+			_peasantMode = 0;
+			_peasantShould = 0;
 			break;
 
 		case 14:
-			switch (_field92) {
+			switch (_peasantShould) {
 				case 6:
 				terminateMachine(_rebusAmuletMach);
 				if (inv_player_has("REBUS AMULET")) {
@@ -1512,7 +1512,7 @@ void Room207::daemon() {
 			break; // case 14
 
 		case 16:
-			if (_field92 == 16) {
+			if (_peasantShould == 16) {
 				kernel_timing_trigger(30, 100, nullptr);
 			} else {
 				digi_play("203p01", 1);
@@ -1522,8 +1522,8 @@ void Room207::daemon() {
 			break;
 
 		default:
-			if (_field8E <= 0) {
-				if (_field92 == 6) {
+			if (_peasantMode <= 0) {
+				if (_peasantShould == 6) {
 					terminateMachine(_ppSquatMach);
 					_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 3840, false, triggerMachineByHashCallback, "pp squat");
 					terminateMachine(_rebusAmuletMach);
@@ -1532,8 +1532,8 @@ void Room207::daemon() {
 					} else {
 						sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 1, 52, 100, _ppShowsAmuletTakesMoneySeries, 52, 52, 0);
 					}
-					_field8E = 6;
-				} else if (_field92 == 7) {
+					_peasantMode = 6;
+				} else if (_peasantShould == 7) {
 					terminateMachine(_ppSquatMach);
 					_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 3840, false, triggerMachineByHashCallback, "pp squat");
 					terminateMachine(_rebusAmuletMach);
@@ -1542,8 +1542,8 @@ void Room207::daemon() {
 					} else {
 						sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 1, 52, 100, _ppShowsAmuletTakesMoneySeries, 52, 52, 0);
 					}
-					_field8E = 7;
-				} else if (_field92 == 9) {
+					_peasantMode = 7;
+				} else if (_peasantShould == 9) {
 					terminateMachine(_ppSquatMach);
 					_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 3840, false, triggerMachineByHashCallback, "pp squat");
 					if (inv_player_has("REBUS AMULET")) {
@@ -1551,8 +1551,8 @@ void Room207::daemon() {
 					} else {
 						sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 1, 16, 100, _ppShowsAmuletTakesMoneySeries, 16, 16, 0);
 					}
-					_field8E = 9;
-				} else if (_field92 == 13) {
+					_peasantMode = 9;
+				} else if (_peasantShould == 13) {
 					terminateMachine(_ppSquatMach);
 					_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 3840, false, triggerMachineByHashCallback, "pp squat");
 					if (inv_player_has("REBUS AMULET")) {
@@ -1560,14 +1560,14 @@ void Room207::daemon() {
 					} else {
 						sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 1, 14, 100, _ppShowsAmuletTakesMoneySeries, 14, 14, 0);
 					}
-					_field92 = 15;
-					_field8E = 14;
-				} else if (_field92 == 16) {
+					_peasantShould = 15;
+					_peasantMode = 14;
+				} else if (_peasantShould == 16) {
 					terminateMachine(_ppSquatMach);
 					_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 514, 367, 97, 3840, 0, triggerMachineByHashCallback, "pp squat");
 					sendWSMessage_10000(1, _ppSquatMach, _peskyBegLoopSeries, 1, 15, 110, _peskyBegLoopSeries, 15, 15, 0);
-					_field8E = 16;
-				} else if (_field92 <= 0) {
+					_peasantMode = 16;
+				} else if (_peasantShould <= 0) {
 					if (_commandNotAllowedFl) {
 						_commandNotAllowedFl = false;
 						player_set_commands_allowed(true);
@@ -1594,7 +1594,7 @@ void Room207::daemon() {
 						series = _peskyPointsRipBackgroundSeries = series_load("pesky points at rip background", -1, nullptr);
 					}
 					sendWSMessage_10000(1, _ppSquatMach, series, 1, 21, 100, series, 21, 21, 1);
-					_field8E = 2;
+					_peasantMode = 2;
 				}
 			}
 			break;
@@ -1602,8 +1602,8 @@ void Room207::daemon() {
 		break;
 
 	case 102:
-		_field92 = 2;
-		_field8E = 2;
+		_peasantShould = 2;
+		_peasantMode = 2;
 		player_set_commands_allowed(true);
 		_pipeFlag = true;
 		kernel_timing_trigger(1, 100, nullptr);
@@ -1622,7 +1622,7 @@ void Room207::daemon() {
 			sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 53, 74, 100, _ppShowsAmuletTakesMoneySeries, 74, 74, 0);
 		}
 
-		_field8E = 12;
+		_peasantMode = 12;
 		_commandNotAllowedFl = true;
 		_G(kernel).trigger_mode = KT_PARSE;
 
@@ -1630,7 +1630,7 @@ void Room207::daemon() {
 		break;
 
 	case 104:
-		_field8E = 12;
+		_peasantMode = 12;
 		_G(kernel).trigger_mode = KT_PARSE;
 		kernel_timing_trigger(30, 5, nullptr);
 		_G(kernel).trigger_mode = KT_DAEMON;
@@ -1642,7 +1642,7 @@ void Room207::daemon() {
 		terminateMachine(_ppSquatMach);
 		_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 514, 367, 97, 3840, 0, triggerMachineByHashCallback, "pp squat");
 		sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 1, 100, _peskyRockLoopSeries, 1, 1, 0);
-		_field8E = 0;
+		_peasantMode = 0;
 
 		break;
 
@@ -1656,8 +1656,8 @@ void Room207::daemon() {
 		else
 			sendWSMessage_10000(1, _ppSquatMach, _ppShowsAmuletTakesMoneySeries, 52, 1, 108, _ppShowsAmuletTakesMoneySeries, 1, 1, 0);
 
-		_field92 = 0;
-		_field8E = 0;
+		_peasantShould = 0;
+		_peasantMode = 0;
 
 		break;
 
@@ -1667,7 +1667,7 @@ void Room207::daemon() {
 		_rebusAmuletMach = series_show_sprite("rebus amulet", 0, 3840);
 		sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 1, 100, _peskyRockLoopSeries, 1, 1, 0);
 
-		_field8E = 0;
+		_peasantMode = 0;
 		_fieldC2 = 3;
 		_commandNotAllowedFl = false;
 		_node1Entry2Fl = false;
@@ -1687,7 +1687,7 @@ void Room207::daemon() {
 		_ppSquatMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 514, 367, 97, 3840, false, triggerMachineByHashCallback, "pp squat");
 		sendWSMessage_10000(1, _ppSquatMach, _peskyRockLoopSeries, 1, 1, 100, _peskyRockLoopSeries, 1, 1, 0);
 
-		_field8E = 0;
+		_peasantMode = 0;
 		_commandNotAllowedFl = true;
 
 		break;
@@ -1727,13 +1727,13 @@ void Room207::convHandler() {
 	if (_G(kernel).trigger == 1) {
 		int32 who = conv_whos_talking();
 		if (who <= 0)
-			_field92 = 15;
+			_peasantShould = 15;
 		else if (who == 1)
 			_fieldC2 = 0;
 	} else {
 		int32 who = conv_whos_talking();
 		if (who <= 0)
-			_field92 = 14;
+			_peasantShould = 14;
 		else if (who == 1) {
 			_fieldC2 = 2;
 			if (conv_current_node() == 1 && conv_current_entry() == 2)
@@ -1749,6 +1749,17 @@ void Room207::convHandler() {
 	conv_resume(conv_get_handle());
 }
 
+void Room207::syncGame(Common::Serializer &s) {
+	s.syncAsByte(_pipeFlag);
+	s.syncAsByte(_commandNotAllowedFl);
+	s.syncAsByte(_ripForegroundFl);
+
+	s.syncAsSint32LE(_peasantMode);
+	s.syncAsSint32LE(_peasantShould);
+	s.syncAsSint32LE(_field8A);
+	s.syncAsSint32LE(_fieldAE_rnd);
+}
+
 } // namespace Rooms
 } // namespace Riddle
 } // namespace M4
diff --git a/engines/m4/riddle/rooms/section2/room207.h b/engines/m4/riddle/rooms/section2/room207.h
index a1e363661b4..52c90d83b00 100644
--- a/engines/m4/riddle/rooms/section2/room207.h
+++ b/engines/m4/riddle/rooms/section2/room207.h
@@ -38,12 +38,13 @@ public:
 	void pre_parser() override;
 	void parser() override;
 	void daemon() override;
+	void syncGame(Common::Serializer &s) override;
 
 private:
 	int32 _field88 = 0; // unused?
 	int32 _field8A = 0;
-	int32 _field8E = 0;
-	int32 _field92 = 0;
+	int32 _peasantMode = 0;
+	int32 _peasantShould = 0;
 	bool _fieldA4 = false; // always false??
 	int32 _fieldA8 = 0; // unused ?
 	bool _pipeFlag = false;
diff --git a/engines/m4/riddle/rooms/section4/room413.cpp b/engines/m4/riddle/rooms/section4/room413.cpp
index 05df3d8fd1d..2e4640bca71 100644
--- a/engines/m4/riddle/rooms/section4/room413.cpp
+++ b/engines/m4/riddle/rooms/section4/room413.cpp
@@ -46,7 +46,7 @@ void Room413::daemon() {
 		break;
 
 	case 27:
-		digi_play(_G(game).previous_room == 301 ? "413r02" : "4013r01", 1, 255, 30);
+		digi_play(_G(game).previous_room == 301 ? "413r02" : "413r01", 1, 255, 30);
 		break;
 
 	case 30:


Commit: 674e7b0dd18359fc70f255272e8a16d93aa24bc7
    https://github.com/scummvm/scummvm/commit/674e7b0dd18359fc70f255272e8a16d93aa24bc7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-11-09T17:23:41-08:00

Commit Message:
M4: RIDDLE: Fix restoring autosave to undo death

Changed paths:
    engines/m4/riddle/rooms/room.cpp


diff --git a/engines/m4/riddle/rooms/room.cpp b/engines/m4/riddle/rooms/room.cpp
index 06d9e5e24dc..0988993decd 100644
--- a/engines/m4/riddle/rooms/room.cpp
+++ b/engines/m4/riddle/rooms/room.cpp
@@ -36,15 +36,8 @@ void Room::preload() {
 }
 
 void Room::restoreAutosave() {
-	if (g_engine->autosaveExists()) {
-		_G(kernel).restore_slot = 0;
-		auto oldMode = _G(kernel).trigger_mode;
-		_G(kernel).trigger_mode = KT_DAEMON;
-		disable_player_commands_and_fade_init(255);
-
-		_G(kernel).trigger_mode = oldMode;
-		player_set_commands_allowed(false);
-	}
+	if (g_engine->loadGameState(0).getCode() != Common::kNoError)
+		error("Could not restore autosave");
 }
 
 int Room::checkFlags(bool flag) {




More information about the Scummvm-git-logs mailing list