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

dreammaster noreply at scummvm.org
Fri Nov 22 06:35:57 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:
c96012f37f M4: Fix flags array to only allow Flag enums


Commit: c96012f37f7a45c2171eec7732f5983195f2c838
    https://github.com/scummvm/scummvm/commit/c96012f37f7a45c2171eec7732f5983195f2c838
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-11-21T22:35:45-08:00

Commit Message:
M4: Fix flags array to only allow Flag enums

Changed paths:
    engines/m4/burger/console.cpp
    engines/m4/burger/flags.cpp
    engines/m4/burger/flags.h
    engines/m4/burger/rooms/section1/room102.cpp
    engines/m4/burger/rooms/section1/room103.cpp
    engines/m4/burger/rooms/section1/section1.cpp
    engines/m4/burger/rooms/section3/room304.cpp
    engines/m4/burger/rooms/section5/room507.cpp
    engines/m4/burger/rooms/section8/room801.cpp
    engines/m4/gui/hotkeys.cpp
    engines/m4/riddle/console.cpp
    engines/m4/riddle/flags.cpp
    engines/m4/riddle/flags.h
    engines/m4/riddle/riddle.cpp
    engines/m4/riddle/rooms/room.cpp
    engines/m4/riddle/rooms/section2/room201.cpp
    engines/m4/riddle/rooms/section3/room301.cpp
    engines/m4/riddle/rooms/section3/room305.cpp
    engines/m4/riddle/rooms/section4/room401.cpp
    engines/m4/riddle/rooms/section4/room402.cpp
    engines/m4/riddle/rooms/section4/room403.cpp
    engines/m4/riddle/rooms/section4/room404.cpp
    engines/m4/riddle/rooms/section4/room407.cpp
    engines/m4/riddle/rooms/section4/room408.cpp
    engines/m4/riddle/rooms/section5/room501.cpp
    engines/m4/riddle/rooms/section5/room504.cpp
    engines/m4/riddle/rooms/section5/room507.cpp
    engines/m4/riddle/rooms/section6/room603.cpp
    engines/m4/riddle/rooms/section6/room604.cpp
    engines/m4/riddle/rooms/section6/room608.cpp
    engines/m4/riddle/rooms/section6/room610.cpp
    engines/m4/riddle/rooms/section8/room802.cpp
    engines/m4/riddle/rooms/section8/room806.cpp
    engines/m4/riddle/vars.cpp


diff --git a/engines/m4/burger/console.cpp b/engines/m4/burger/console.cpp
index 2414946a794..c1482870f5b 100644
--- a/engines/m4/burger/console.cpp
+++ b/engines/m4/burger/console.cpp
@@ -35,14 +35,14 @@ Console::Console() : M4::Console() {
 bool Console::cmdGlobal(int argc, const char **argv) {
 	if (argc == 2) {
 		int flagNum = atol(argv[1]);
-		debugPrintf("Global %d = %d\n", flagNum, _G(flags)[flagNum]);
+		debugPrintf("Flag %d = %d\n", flagNum, _G(flags)[(Flag)flagNum]);
 	} else if (argc == 3) {
 		int flagNum = atol(argv[1]);
 		int flagVal = atol(argv[2]);
-		_G(flags)[flagNum] = flagVal;
-		debugPrintf("Global set\n");
+		_G(flags)[(Flag)flagNum] = flagVal;
+		debugPrintf("Flag set\n");
 	} else {
-		debugPrintf("Global <num> [<value>]\n");
+		debugPrintf("global <num> [<value>]\n");
 	}
 
 	return true;
diff --git a/engines/m4/burger/flags.cpp b/engines/m4/burger/flags.cpp
index 2eb262fcfe8..9f181461f59 100644
--- a/engines/m4/burger/flags.cpp
+++ b/engines/m4/burger/flags.cpp
@@ -64,11 +64,11 @@ Flags::Flags() {
 void Flags::sync(Common::Serializer &s) {
 	size_t count = size();
 	for (uint i = 0; i < count; ++i)
-		s.syncAsSint32LE((*this)[i]);
+		s.syncAsSint32LE(_flags[i]);
 }
 
 void Flags::reset() {
-	Common::fill(&(*this)[0], &(*this)[0] + FLAGS_COUNT, 0);
+	Common::fill(_flags, _flags + FLAGS_COUNT, 0);
 }
 
 int32 Flags::get_boonsville_time_and_display(bool showTime) {
diff --git a/engines/m4/burger/flags.h b/engines/m4/burger/flags.h
index 38b9b6e28ff..c7a9f460931 100644
--- a/engines/m4/burger/flags.h
+++ b/engines/m4/burger/flags.h
@@ -31,7 +31,7 @@ namespace Burger {
 
 #define FLAGS_COUNT 512
 
-enum {
+enum Flag {
 	V000 =   0,
 	V001 =   1,
 	V002 =   2,
@@ -584,9 +584,9 @@ public:
 	size_t size() const {
 		return FLAGS_COUNT;
 	}
-	int32 &operator[](uint idx) {
-		assert(idx < FLAGS_COUNT);
-		return _flags[idx];
+	int32 &operator[](Flag flag) {
+		assert((int)flag < FLAGS_COUNT);
+		return _flags[flag];
 	}
 
 	const char *getConvName();
diff --git a/engines/m4/burger/rooms/section1/room102.cpp b/engines/m4/burger/rooms/section1/room102.cpp
index 55c5404fa95..2a24e3312f7 100644
--- a/engines/m4/burger/rooms/section1/room102.cpp
+++ b/engines/m4/burger/rooms/section1/room102.cpp
@@ -195,7 +195,7 @@ void Room102::daemon() {
 					_harryMode = 26;
 					term_message("change channel");
 				} else {
-					digi_play(getDigi1(_G(flags)[GLB_TEMP_2]), 2, 255, 18);
+					digi_play(getDigi1(_G(flags)[V008]), 2, 255, 18);
 					_val9 = 1;
 					_harryMode = 20;
 					term_message("mumble");
@@ -474,7 +474,7 @@ void Room102::daemon() {
 
 			case 37:
 				_harryMode = 39;
-				_G(flags)[GLB_TEMP_5] = 2;
+				_G(flags)[V011] = 2;
 				digi_preload_stream_breaks(STREAMS2);
 				series_play("102ha09s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
 				series_stream_with_breaks(STREAMS2, "102ha09", 6, 0x100, 3);
@@ -482,7 +482,7 @@ void Room102::daemon() {
 
 			case 38:
 				_harryMode = 40;
-				_G(flags)[GLB_TEMP_5] = 1;
+				_G(flags)[V011] = 1;
 				digi_preload_stream_breaks(STREAMS3);
 				series_play("102ha10s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
 				series_stream_with_breaks(STREAMS3, "102ha10", 6, 0x100, 3);
@@ -1377,26 +1377,26 @@ void Room102::setup(int val1, int val2) {
 	if (val2)
 		digi_play_loop("102_001", 3, 255, -1);
 	if (_val1) {
-		digi_unload(getDigi1(_G(flags)[GLB_TEMP_2]));
-		digi_unload(getDigi2(_G(flags)[GLB_TEMP_2]));
+		digi_unload(getDigi1(_G(flags)[V008]));
+		digi_unload(getDigi2(_G(flags)[V008]));
 	}
 
 	if (val1) {
-		_G(flags)[GLB_TEMP_2] = val1;
+		_G(flags)[V008] = val1;
 	} else {
-		if (++_G(flags)[GLB_TEMP_2] == 36)
-			_G(flags)[GLB_TEMP_2] = 1;
+		if (++_G(flags)[V008] == 36)
+			_G(flags)[V008] = 1;
 	}
 
 	_val1 = 1;
-	digi_preload(getDigi1(_G(flags)[GLB_TEMP_2]));
-	digi_preload(getDigi2(_G(flags)[GLB_TEMP_2]));
+	digi_preload(getDigi1(_G(flags)[V008]));
+	digi_preload(getDigi2(_G(flags)[V008]));
 
 	if (val2)
 		digi_stop(3);
 
-	digi_play_loop(getDigi2(_G(flags)[GLB_TEMP_2]), 3, 255, -1);
-	_val10 = timer_read_60() + digi_ticks_to_play(getDigi2(_G(flags)[GLB_TEMP_2]));
+	digi_play_loop(getDigi2(_G(flags)[V008]), 3, 255, -1);
+	_val10 = timer_read_60() + digi_ticks_to_play(getDigi2(_G(flags)[V008]));
 	_val8 = 0;
 }
 
@@ -1642,7 +1642,7 @@ void Room102::conv06() {
 			if (node == 1 && entry == 1) {
 				_wilburChairShould = 63;
 			} else if (node == 2) {
-				_harryMode = _G(flags)[GLB_TEMP_4] == 1 ? 49 : 48;
+				_harryMode = _G(flags)[V010] == 1 ? 49 : 48;
 				_wilburChairShould = 58;
 			} else {
 				_wilburChairShould = 58;
@@ -1652,9 +1652,9 @@ void Room102::conv06() {
 	} else if (sound) {
 		if (who <= 0) {
 			if (node == 1 && entry == 3) {
-				_G(flags)[GLB_TEMP_4] = 3;
+				_G(flags)[V010] = 3;
 
-				if (_G(flags)[GLB_TEMP_5] == 1)
+				if (_G(flags)[V011] == 1)
 					_G(flags)[V021] = 10034;
 			}
 
@@ -1665,16 +1665,16 @@ void Room102::conv06() {
 				return;
 
 			} else if (node == 1 && entry == 1) {
-				_G(flags)[GLB_TEMP_4] = 1;
+				_G(flags)[V010] = 1;
 				_G(flags)[V001] -= 8;
 
-				if (_G(flags)[GLB_TEMP_5] == 1)
+				if (_G(flags)[V011] == 1)
 					_G(flags)[V021] = 10032;
 			} else if (node == 1 && entry == 4) {
 				_harryMode = 21;
-				_G(flags)[GLB_TEMP_4] = 2;
+				_G(flags)[V010] = 2;
 
-				if (_G(flags)[GLB_TEMP_5] == 1)
+				if (_G(flags)[V011] == 1)
 					_G(flags)[V021] = 10033;
 
 				_G(flags)[V013] = 1;
diff --git a/engines/m4/burger/rooms/section1/room103.cpp b/engines/m4/burger/rooms/section1/room103.cpp
index 0e528f9d93e..41b2aaa634e 100644
--- a/engines/m4/burger/rooms/section1/room103.cpp
+++ b/engines/m4/burger/rooms/section1/room103.cpp
@@ -233,7 +233,7 @@ void Room103::daemon() {
 
 	case 7:
 		_G(flags)[kHarryComingToRoof] = 0;
-		_G(flags)[GLB_TEMP_3] = _G(flags).get_boonsville_time_and_display() + 1800;
+		_G(flags)[V009] = _G(flags).get_boonsville_time_and_display() + 1800;
 		_G(flags)[V012] = 2;
 		pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1001);
 		break;
@@ -527,7 +527,7 @@ void Room103::daemon() {
 		break;
 
 	case 23:
-		if (_G(flags)[GLB_TEMP_4] == 2 || _G(flags)[V013]) {
+		if (_G(flags)[V010] == 2 || _G(flags)[V013]) {
 			switch (imath_ranged_rand(1, 3)) {
 			case 1:
 				digi_play("103h008a", 1, 255, 21);
@@ -545,7 +545,7 @@ void Room103::daemon() {
 			digi_play("103h007", 1, 255, 21);
 		}
 
-		_G(flags)[GLB_TEMP_3] = _G(flags).get_boonsville_time_and_display() + 1800;
+		_G(flags)[V009] = _G(flags).get_boonsville_time_and_display() + 1800;
 		_G(flags)[V012] = 2;
 		ws_walk(271, 265, 0, 24, 2);
 		break;
diff --git a/engines/m4/burger/rooms/section1/section1.cpp b/engines/m4/burger/rooms/section1/section1.cpp
index b7958fc91be..f1bc124dad4 100644
--- a/engines/m4/burger/rooms/section1/section1.cpp
+++ b/engines/m4/burger/rooms/section1/section1.cpp
@@ -227,9 +227,9 @@ void Section1::daemon() {
 
 	case kAdvanceTime:
 		if (_G(flags)[V012] == 2) {
-			term_message("  Harry watches tv at: %d", _G(flags)[GLB_TEMP_3]);
+			term_message("  Harry watches tv at: %d", _G(flags)[V009]);
 
-			if (_G(flags).get_boonsville_time_and_display() == (int32)_G(flags)[GLB_TEMP_3]) {
+			if (_G(flags).get_boonsville_time_and_display() == (int32)_G(flags)[V009]) {
 				if (_G(game).room_id == 102) {
 					term_message("make harry walk in");
 					kernel_timing_trigger(1, 1037);
diff --git a/engines/m4/burger/rooms/section3/room304.cpp b/engines/m4/burger/rooms/section3/room304.cpp
index 5c4d19c6f40..f9eaa09486b 100644
--- a/engines/m4/burger/rooms/section3/room304.cpp
+++ b/engines/m4/burger/rooms/section3/room304.cpp
@@ -88,7 +88,7 @@ const seriesPlayBreak Room304::PLAY5[] = {
 };
 
 const char *Room304::getDigi() {
-	return _G(flags)[130] ? "304_003" : "300_005";
+	return _G(flags)[V130] ? "304_003" : "300_005";
 }
 
 void Room304::init() {
diff --git a/engines/m4/burger/rooms/section5/room507.cpp b/engines/m4/burger/rooms/section5/room507.cpp
index 9ad05c19247..d9d09a2f3f1 100644
--- a/engines/m4/burger/rooms/section5/room507.cpp
+++ b/engines/m4/burger/rooms/section5/room507.cpp
@@ -690,7 +690,7 @@ void Room507::parser() {
 	if (player_said("LOOK AT", "BORK") && _G(flags)[V223] == 1) {
 		wilbur_speech("507w003");
 	} else if (player_said("RUBBER DUCKY") && player_said("TUB")) {
-		wilbur_speech(_G(flags)[223] ? "500w040" : "500w039");
+		wilbur_speech(_G(flags)[V223] ? "500w040" : "500w039");
 	} else if (player_said("RUBBER DUCKY") && player_said("SINK")) {
 		wilbur_speech("500w041");
 	} else if (player_said("SOAPY WATER", "SINK")) {
diff --git a/engines/m4/burger/rooms/section8/room801.cpp b/engines/m4/burger/rooms/section8/room801.cpp
index 22b69d4ece6..bf412e47cb1 100644
--- a/engines/m4/burger/rooms/section8/room801.cpp
+++ b/engines/m4/burger/rooms/section8/room801.cpp
@@ -139,7 +139,7 @@ void Room801::init() {
 	_wilburMode = 10;
 	digi_preload("800_001");
 
-	if (_G(flags)[GLB_TEMP_5] == 1) {
+	if (_G(flags)[V011] == 1) {
 		term_message(HEADER);
 		term_message("Toxic wax in hair");
 
@@ -430,7 +430,7 @@ void Room801::daemon() {
 		break;
 
 	case 23:
-		if (_G(flags)[GLB_TEMP_5] == 1) {
+		if (_G(flags)[V011] == 1) {
 			kernel_trigger_dispatch_now(24);
 		} else if (_G(flags)[kNEURO_TEST_COUNTER] <= 2) {
 			digi_unload("804_003");
@@ -542,7 +542,7 @@ void Room801::daemon() {
 		break;
 
 	case 42:
-		if (_G(flags)[GLB_TEMP_5] != 1)
+		if (_G(flags)[V011] != 1)
 			digi_play("806w001", 1, 128);
 		break;
 
diff --git a/engines/m4/gui/hotkeys.cpp b/engines/m4/gui/hotkeys.cpp
index 50e3a7cf382..d65c2b1e3fe 100644
--- a/engines/m4/gui/hotkeys.cpp
+++ b/engines/m4/gui/hotkeys.cpp
@@ -286,8 +286,8 @@ void Hotkeys::changeGlobalChange(void *, void *) {
 
 	// Create secondary dialog to get value to set global to
 	int globalVal = (g_engine->getGameType() == GType_Burger) ?
-		Burger::g_vars->_flags[_globalToChange] :
-		Riddle::g_vars->_flags[_globalToChange];
+		Burger::g_vars->_flags[(Burger::Flag)_globalToChange] :
+		Riddle::g_vars->_flags[(Riddle::Flag)_globalToChange];
 
 	_changeGlobalDialog = DialogCreateAbsolute(250, 120, 450, 220, 242);
 	_changeGlobalDialog->addButton(60, 40,
@@ -308,9 +308,9 @@ void Hotkeys::changeGlobalDoChange(void *, void *) {
 	int globalVal = atoi(textField->prompt);
 
 	if (g_engine->getGameType() == GType_Burger)
-		Burger::g_vars->_flags[_globalToChange] = globalVal;
+		Burger::g_vars->_flags[(Burger::Flag)_globalToChange] = globalVal;
 	else
-		Riddle::g_vars->_flags[_globalToChange] = globalVal;
+		Riddle::g_vars->_flags[(Riddle::Flag)_globalToChange] = globalVal;
 
 	_changeGlobalDialog->destroy();
 	_changeGlobalDialog = nullptr;
diff --git a/engines/m4/riddle/console.cpp b/engines/m4/riddle/console.cpp
index f6f935bc68a..d548d8ba963 100644
--- a/engines/m4/riddle/console.cpp
+++ b/engines/m4/riddle/console.cpp
@@ -35,11 +35,11 @@ Console::Console() : M4::Console() {
 bool Console::cmdGlobal(int argc, const char **argv) {
 	if (argc == 2) {
 		int flagNum = atol(argv[1]);
-		debugPrintf("Global %d = %d\n", flagNum, _G(flags)[flagNum]);
+		debugPrintf("Global %d = %d\n", flagNum, _G(flags)[(Flag)flagNum]);
 	} else if (argc == 3) {
 		int flagNum = atol(argv[1]);
 		int flagVal = atol(argv[2]);
-		_G(flags)[flagNum] = flagVal;
+		_G(flags)[(Flag)flagNum] = flagVal;
 		debugPrintf("Global set\n");
 	} else {
 		debugPrintf("Global <num> [<value>]\n");
diff --git a/engines/m4/riddle/flags.cpp b/engines/m4/riddle/flags.cpp
index f79ee507634..ab2bff2a1cf 100644
--- a/engines/m4/riddle/flags.cpp
+++ b/engines/m4/riddle/flags.cpp
@@ -37,11 +37,11 @@ Flags::Flags() {
 void Flags::sync(Common::Serializer &s) {
 	size_t count = size();
 	for (uint i = 0; i < count; ++i)
-		s.syncAsSint32LE((*this)[i]);
+		s.syncAsSint32LE(_flags[i]);
 }
 
 void Flags::reset() {
-	Common::fill(&(*this)[0], &(*this)[0] + FLAGS_COUNT, 0);
+	Common::fill(_flags, _flags + FLAGS_COUNT, 0);
 	_flags[V071] = 2;
 	_flags[V088] = 1;
 	_flags[V086] = 2;
diff --git a/engines/m4/riddle/flags.h b/engines/m4/riddle/flags.h
index 4a2c78e38fb..4044709b7f5 100644
--- a/engines/m4/riddle/flags.h
+++ b/engines/m4/riddle/flags.h
@@ -31,7 +31,7 @@ namespace Riddle {
 
 #define FLAGS_COUNT 512
 
-enum {
+enum Flag {
 	V000 =   0,
 	V001 =   1,
 	V002 =   2,
@@ -566,9 +566,9 @@ public:
 	size_t size() const {
 		return FLAGS_COUNT;
 	}
-	int32 &operator[](uint idx) {
-		assert(idx < FLAGS_COUNT);
-		return _flags[idx];
+	int32 &operator[](Flag flag) {
+		assert((int)flag < FLAGS_COUNT);
+		return _flags[flag];
 	}
 
 	/**
diff --git a/engines/m4/riddle/riddle.cpp b/engines/m4/riddle/riddle.cpp
index 031d8b19a16..93857d77b07 100644
--- a/engines/m4/riddle/riddle.cpp
+++ b/engines/m4/riddle/riddle.cpp
@@ -311,7 +311,7 @@ void RiddleEngine::global_parser() {
 			if (_messageLog._result != 16) {
 				_G(flags)[V052] = 1;
 
-				if (_G(player).walker_in_this_scene && _G(flags)[292]) {
+				if (_G(player).walker_in_this_scene && _G(flags)[V292]) {
 					player_update_info();
 
 					switch (_G(player_info).facing) {
diff --git a/engines/m4/riddle/rooms/room.cpp b/engines/m4/riddle/rooms/room.cpp
index 0988993decd..d7c1d588aca 100644
--- a/engines/m4/riddle/rooms/room.cpp
+++ b/engines/m4/riddle/rooms/room.cpp
@@ -168,7 +168,7 @@ bool Room::setItemsPlacedFlags() {
 		break;
 	}
 
-	_G(flags)[GLB_TEMP_1] = 0;
+	_G(flags)[V007] = 0;
 	return false;
 }
 
diff --git a/engines/m4/riddle/rooms/section2/room201.cpp b/engines/m4/riddle/rooms/section2/room201.cpp
index 1395a3071cd..8db8d293ec2 100644
--- a/engines/m4/riddle/rooms/section2/room201.cpp
+++ b/engines/m4/riddle/rooms/section2/room201.cpp
@@ -460,7 +460,7 @@ void Room201::daemon() {
 		_ripHandChin = series_load("RIP TREK HAND CHIN POS3");
 		setGlobals1(_ripHandChin, 1, 14, 14, 14);
 		sendWSMessage_110000(320);
-		digi_play(_G(flags)[GLB_TEMP_2] == 1 ? "201r05" : "201r06", 1, 255, 320);
+		digi_play(_G(flags)[V008] == 1 ? "201r05" : "201r06", 1, 255, 320);
 		break;
 
 	case 320:
@@ -1798,8 +1798,8 @@ void Room201::checkFlags() {
 	}
 
 	for (int i = V365; i <= V373; ++i) {
-		if (_G(flags)[i] == 1) {
-			_G(flags)[i - 10] = 1;
+		if (_G(flags)[(Flag)i] == 1) {
+			_G(flags)[(Flag)(i - 10)] = 1;
 			++_val1;
 		}
 	}
diff --git a/engines/m4/riddle/rooms/section3/room301.cpp b/engines/m4/riddle/rooms/section3/room301.cpp
index 1436cb862a5..7de31043027 100644
--- a/engines/m4/riddle/rooms/section3/room301.cpp
+++ b/engines/m4/riddle/rooms/section3/room301.cpp
@@ -458,7 +458,7 @@ void Room301::daemon() {
 		break;
 
 	case 15:
-		_G(flags)[GLB_TEMP_2] = 1;
+		_G(flags)[V008] = 1;
 		sendWSMessage_10000(1, _george, _agentSlidesPaper, 49, 1, 12,
 			_agentStander, 1, 1, 0);
 		break;
@@ -869,7 +869,7 @@ void Room301::daemon() {
 }
 
 void Room301::pre_parser() {
-	if (player_said("exit") && _G(flags)[GLB_TEMP_1]) {
+	if (player_said("exit") && _G(flags)[V007]) {
 		_G(player).need_to_walk = false;
 		_G(player).ready_to_walk = true;
 		_G(player).waiting_for_walk = false;
@@ -886,7 +886,7 @@ void Room301::parser() {
 	if (player_said("conv301a")) {
 		conv301a();
 	} else if (player_said("exit")) {
-		if (_G(flags)[GLB_TEMP_1]) {
+		if (_G(flags)[V007]) {
 			if (_G(kernel).trigger == -1) {
 				player_set_commands_allowed(false);
 				_marshalMatt = series_load("marshall matt");
diff --git a/engines/m4/riddle/rooms/section3/room305.cpp b/engines/m4/riddle/rooms/section3/room305.cpp
index b92fb24210f..83199842ffc 100644
--- a/engines/m4/riddle/rooms/section3/room305.cpp
+++ b/engines/m4/riddle/rooms/section3/room305.cpp
@@ -679,7 +679,7 @@ void Room305::parser() {
 	} else if (takeFlag && player_said("turtle treats")) {
 		takeTurtleTreats();
 	} else if (takeFlag && player_said("turtle")) {
-		if (_G(flags)[GLB_TEMP_12]) {
+		if (_G(flags)[V018]) {
 			digi_play("305r55", 1);
 		} else {
 			switch (_G(kernel).trigger) {
@@ -1078,7 +1078,7 @@ next4:
 	} else if (lookFlag && player_said("terrarium")) {
 		if (inv_player_has("TURTLE")) {
 			digi_play("305r16a", 1);
-		} else if (_G(flags)[GLB_TEMP_12]) {
+		} else if (_G(flags)[V018]) {
 			digi_play("305r16b", 1);
 		} else if (inv_object_is_here("TURTLE")) {
 			digi_play("305r16c", 1);
diff --git a/engines/m4/riddle/rooms/section4/room401.cpp b/engines/m4/riddle/rooms/section4/room401.cpp
index e8cbec1ba69..0c593c8dfe4 100644
--- a/engines/m4/riddle/rooms/section4/room401.cpp
+++ b/engines/m4/riddle/rooms/section4/room401.cpp
@@ -86,10 +86,10 @@ void Room401::init() {
 		ws_demand_location(66, 266, 3);
 
 		if (_val1 ||
-			!_G(flags)[GLB_TEMP_14] ||
-			(_G(flags)[V110] && !_G(flags)[GLB_TEMP_10]) ||
-			(_G(flags)[GLB_TEMP_11] && player_been_here(407) && !_G(flags)[GLB_TEMP_13]) ||
-			(_G(flags)[GLB_TEMP_12] && !_G(flags)[V091])
+			!_G(flags)[V020] ||
+			(_G(flags)[V110] && !_G(flags)[V016]) ||
+			(_G(flags)[V017] && player_been_here(407) && !_G(flags)[V019]) ||
+			(_G(flags)[V018] && !_G(flags)[V091])
 		) {
 			ws_walk(346, 267, 0, 7, 3, 1);
 		} else {
@@ -453,7 +453,7 @@ void Room401::daemon() {
 	case 412:
 		_agentShould = 0;
 		kernel_timing_trigger(1, 100);
-		_G(flags)[GLB_TEMP_14] = 1;
+		_G(flags)[V020] = 1;
 		kernel_timing_trigger(1, 1000);
 		break;
 
@@ -521,7 +521,7 @@ void Room401::daemon() {
 	case 518:
 		series_show("401a06", 0x600, 16);
 		sendWSMessage_10000(1, _agent, _401a01, 1, 1, 100, _401a01, 1, 1, 0);
-		_G(flags)[GLB_TEMP_10] = 1;
+		_G(flags)[V016] = 1;
 		_G(flags)[V366] = 1;
 
 		_ripMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, 0,
@@ -570,7 +570,7 @@ void Room401::daemon() {
 			triggerMachineByHashCallback, "agent");
 		sendWSMessage_10000(1, _agent, _401a01, 1, 1, 100, _401a01, 1, 1, 0);
 		sendWSMessage_10000(1, _ripMach, _401rp01, 11, 1, 620, _401rp01, 1, 1, 0);
-		_G(flags)[GLB_TEMP_13] = 1;
+		_G(flags)[V019] = 1;
 		_agentShould = 0;
 		_ctr1 = 0;
 		break;
@@ -579,7 +579,7 @@ void Room401::daemon() {
 		setGlobals1(_rip4, 1, 1, 1, 5, 1);
 		sendWSMessage_110000(705);
 		_agentShould = 4;
-		digi_play(_G(flags)[GLB_TEMP_13] ? "401r33" : "401r34", 1, 255, 705);
+		digi_play(_G(flags)[V019] ? "401r33" : "401r34", 1, 255, 705);
 		break;
 
 	case 705:
@@ -760,14 +760,14 @@ void Room401::daemon() {
 		break;
 
 	case 1000:
-		if (_G(flags)[GLB_TEMP_14]) {
+		if (_G(flags)[V020]) {
 			kernel_timing_trigger(30, 400);
-		} else if (_G(flags)[V110] && !_G(flags)[GLB_TEMP_10]) {
+		} else if (_G(flags)[V110] && !_G(flags)[V016]) {
 			kernel_timing_trigger(30, 500);
-		} else if (_G(flags)[GLB_TEMP_11] && player_been_here(407) &&
-				!_G(flags)[GLB_TEMP_13]) {
+		} else if (_G(flags)[V017] && player_been_here(407) &&
+				!_G(flags)[V019]) {
 			kernel_timing_trigger(30, 600);
-		} else if (_G(flags)[GLB_TEMP_12] && !_G(flags)[V091]) {
+		} else if (_G(flags)[V018] && !_G(flags)[V091]) {
 			kernel_timing_trigger(30, 700);
 		} else {
 			player_set_commands_allowed(true);
@@ -854,7 +854,7 @@ void Room401::parser() {
 	} else if (takeFlag && player_said("BEER STEIN")) {
 		digi_play("203r58", 1);
 	} else if (lookFlag && player_said("BEER STEIN")) {
-		if (_G(flags)[GLB_TEMP_9]) {
+		if (_G(flags)[V015]) {
 			digi_play("401R07", 1);
 		} else {
 			switch (_G(kernel).trigger) {
@@ -898,7 +898,7 @@ void Room401::parser() {
 				_G(kernel).trigger_mode = KT_DAEMON;
 				kernel_timing_trigger(1, 100);
 				_G(kernel).trigger_mode = KT_PARSE;
-				_G(flags)[GLB_TEMP_9] = 1;
+				_G(flags)[V015] = 1;
 				player_set_commands_allowed(true);
 				break;
 			default:
@@ -981,7 +981,7 @@ void Room401::conv401a() {
 		if (who <= 0) {
 			if (node == 3) {
 				_agentShould = 8;
-				_G(flags)[GLB_TEMP_8] = 0;
+				_G(flags)[V014] = 0;
 			} else if (node == 2 && entry == 0) {
 				_agentShould = 10;
 				return;
diff --git a/engines/m4/riddle/rooms/section4/room402.cpp b/engines/m4/riddle/rooms/section4/room402.cpp
index 6c08e8f84ab..2e9ee33ba91 100644
--- a/engines/m4/riddle/rooms/section4/room402.cpp
+++ b/engines/m4/riddle/rooms/section4/room402.cpp
@@ -70,7 +70,7 @@ void Room402::init() {
 	digi_preload("950_s21");
 	digi_preload("950_s23");
 
-	if (!_G(flags)[GLB_TEMP_12] && !_G(flags)[V117]) {
+	if (!_G(flags)[V018] && !_G(flags)[V117]) {
 		if (!_G(flags)[V110])
 			_G(flags)[V131] = 402;
 		else if (inv_player_has("TURTLE"))
@@ -208,7 +208,7 @@ void Room402::init() {
 
 			case 408:
 				if (_G(flags)[V125] == 3) {
-					_G(flags)[GLB_TEMP_12] = 1;
+					_G(flags)[V018] = 1;
 					_G(flags)[V125] = 4;
 					_G(flags)[V131] = 999;
 
diff --git a/engines/m4/riddle/rooms/section4/room403.cpp b/engines/m4/riddle/rooms/section4/room403.cpp
index 54acd6a9cec..6fc8afa2a56 100644
--- a/engines/m4/riddle/rooms/section4/room403.cpp
+++ b/engines/m4/riddle/rooms/section4/room403.cpp
@@ -78,7 +78,7 @@ void Room403::init() {
 		_G(flags)[V313] = player_been_here(403) && (
 			(_G(flags)[V110] && inv_player_has("TURTLE")) ||
 			inv_player_has("STEP LADDER") ||
-			_G(flags)[GLB_TEMP_12] ||
+			_G(flags)[V018] ||
 			!inv_object_is_here("STEP LADDER")) ? 0 : 1;
 		_plank = inv_object_in_scene("PLANK", 403) ? 2 : 0;
 
@@ -131,7 +131,7 @@ void Room403::init() {
 			break;
 		}
 
-		if (_G(flags)[V133] && !_G(flags)[GLB_TEMP_12] && _G(flags)[V131] != 403 &&
+		if (_G(flags)[V133] && !_G(flags)[V018] && _G(flags)[V131] != 403 &&
 				!inv_player_has("TURTLE") && !inv_player_has("EDGER")) {
 			_edger = series_place_sprite("ONE FRAME EDGER", 0, 0, 0, 100, 0xf00);
 			hotspot_set_active("EDGER", true);
diff --git a/engines/m4/riddle/rooms/section4/room404.cpp b/engines/m4/riddle/rooms/section4/room404.cpp
index d8425d9cf6d..e4cfc8f7325 100644
--- a/engines/m4/riddle/rooms/section4/room404.cpp
+++ b/engines/m4/riddle/rooms/section4/room404.cpp
@@ -221,7 +221,7 @@ void Room404::daemon() {
 		break;
 
 	case 43:
-		if (!_G(flags)[GLB_TEMP_12] || _G(flags)[V334]) {
+		if (!_G(flags)[V018] || _G(flags)[V334]) {
 			player_set_commands_allowed(true);
 		} else {
 			_G(flags)[V334] = 1;
diff --git a/engines/m4/riddle/rooms/section4/room407.cpp b/engines/m4/riddle/rooms/section4/room407.cpp
index 91fac9121c0..4c3404916d9 100644
--- a/engines/m4/riddle/rooms/section4/room407.cpp
+++ b/engines/m4/riddle/rooms/section4/room407.cpp
@@ -4541,7 +4541,7 @@ void Room407::takeLetter() {
 	case 13:
 		kernel_examine_inventory_object("PING MENENDEZ'S LETTER",
 			_G(master_palette), 5, 1, 270, 150, 14, "407r41", -1);
-		_G(flags)[GLB_TEMP_11] = 1;
+		_G(flags)[V017] = 1;
 		_G(flags)[V280] = 1;
 		break;
 
diff --git a/engines/m4/riddle/rooms/section4/room408.cpp b/engines/m4/riddle/rooms/section4/room408.cpp
index 1b9ec851e16..1140e44e5f5 100644
--- a/engines/m4/riddle/rooms/section4/room408.cpp
+++ b/engines/m4/riddle/rooms/section4/room408.cpp
@@ -73,13 +73,13 @@ void Room408::init() {
 
 	} else {
 		if (inv_player_has("TURTLE") && !inv_player_has("EDGER") &&
-				!_G(flags)[GLB_TEMP_12]) {
+				!_G(flags)[V018]) {
 			_edger = series_place_sprite("Edger gone", 0, 0, -53, 100, 0xf00);
 			hotspot_set_active("EDGER", true);
 		}
 
 		if (inv_player_has("TURTLE") && !inv_player_has("PLANK") &&
-				!_G(flags)[GLB_TEMP_12] && inv_object_is_here("PLANK")) {
+				!_G(flags)[V018] && inv_object_is_here("PLANK")) {
 			_plank = series_place_sprite("Plank gone", 0, 0, 0, 100, 0xf00);
 			hotspot_set_active("PLANK", true);
 		}
@@ -127,7 +127,7 @@ void Room408::init() {
 			digi_preload("950_s22");
 			terminateMachineAndNull(_exit);
 
-			if (_G(flags)[GLB_TEMP_12]) {
+			if (_G(flags)[V018]) {
 				_G(flags)[V131] = 999;
 			} else if (inv_player_has("TURTLE")) {
 				_G(flags)[V131] = 402;
@@ -152,7 +152,7 @@ void Room408::init() {
 			digi_preload("950_s22");
 
 			if (_G(flags)[V117] && _G(flags)[V125] == 3 &&
-				!_G(flags)[GLB_TEMP_12] && !inv_player_has("EDGER") &&
+				!_G(flags)[V018] && !inv_player_has("EDGER") &&
 				!inv_player_has("PLANK")) {
 				_G(flags)[V131] = 408;
 				_G(flags)[V117] = 0;
diff --git a/engines/m4/riddle/rooms/section5/room501.cpp b/engines/m4/riddle/rooms/section5/room501.cpp
index 5650c457805..1583311ba2c 100644
--- a/engines/m4/riddle/rooms/section5/room501.cpp
+++ b/engines/m4/riddle/rooms/section5/room501.cpp
@@ -459,11 +459,11 @@ void Room501::daemon() {
 		conv_export_pointer_curr(&_hasLetter, 3);
 		conv_export_pointer_curr(&_hasItems, 4);
 		conv_export_pointer_curr(&_G(flags)[V145], 5);
-		conv_export_value_curr(_G(flags)[146] > 0 ? 1 : 0, 6);
+		conv_export_value_curr(_G(flags)[V146] > 0 ? 1 : 0, 6);
 		conv_export_pointer_curr(&_G(flags)[V143], 7);
 		conv_export_pointer_curr(&_G(flags)[V142], 8);
 		conv_export_pointer_curr(&_G(flags)[V147], 9);
-		conv_export_value_curr(_G(flags)[145] == 1 ||
+		conv_export_value_curr(_G(flags)[V145] == 1 ||
 			_G(flags)[V146] > 0 || _G(flags)[V143] == 1 ? 1 : 0, 10);
 
 		_hasStickAndShellMap = inv_player_has("STICK AND SHELL MAP");
diff --git a/engines/m4/riddle/rooms/section5/room504.cpp b/engines/m4/riddle/rooms/section5/room504.cpp
index e394824b6cb..ebc9e58e05a 100644
--- a/engines/m4/riddle/rooms/section5/room504.cpp
+++ b/engines/m4/riddle/rooms/section5/room504.cpp
@@ -3299,7 +3299,7 @@ void Room504::setVinesRope() {
 		addBrownVine();
 	}
 
-	if (_G(flags)[154] == 1) {
+	if (_G(flags)[V154] == 1) {
 		hotspot_set_active("ROPE ", true);
 		hotspot_set_active("ROPE COIL ", true);
 	}
diff --git a/engines/m4/riddle/rooms/section5/room507.cpp b/engines/m4/riddle/rooms/section5/room507.cpp
index 0429bb4ac3a..758c6dfd8e1 100644
--- a/engines/m4/riddle/rooms/section5/room507.cpp
+++ b/engines/m4/riddle/rooms/section5/room507.cpp
@@ -65,7 +65,8 @@ void Room507::init() {
 	for (int i = 1; i <= 7; ++i) {
 		_blockFlag[i] = false;
 		_blockSeries[i] = series_load(BLOCK_NAMES[1]);
-		_block[1] = series_show(BLOCK_NAMES[1], 0x400, 16, -1, -1, _G(flags)[V172 + i]);
+		_block[1] = series_show(BLOCK_NAMES[1], 0x400, 16, -1, -1,
+			_G(flags)[(Flag)(V172 + i)]);
 	}
 
 	_doorSeries = series_load("507DOOR2");
@@ -89,7 +90,7 @@ void Room507::daemon() {
 
 	case 3:
 		for (int i = 1; i <= 7; ++i) {
-			if (_G(flags)[V172 + i] != BLOCK_CORRECT[i]) {
+			if (_G(flags)[(Flag)(V172 + i)] != BLOCK_CORRECT[i]) {
 				player_set_commands_allowed(true);
 				return;
 			}
@@ -202,13 +203,15 @@ void Room507::useStoneGlyph(int blockNum) {
 
 	_G(kernel).trigger_mode = KT_DAEMON;
 	sendWSMessage_190000(_block[blockNum], 15);
-	sendWSMessage_10000(1, _block[blockNum], _blockSeries[blockNum], _G(flags)[V172 + blockNum] + 1, _G(flags)[V172 + blockNum] + 4, 3,
-		_blockSeries[blockNum], _G(flags)[V172 + blockNum] + 5, _G(flags)[V172 + blockNum] + 5, 0);
+	sendWSMessage_10000(1, _block[blockNum], _blockSeries[blockNum],
+		_G(flags)[(Flag)(V172 + blockNum)] + 1, _G(flags)[(Flag)(V172 + blockNum)] + 4, 3,
+		_blockSeries[blockNum], _G(flags)[(Flag)(V172 + blockNum)] + 5,
+		_G(flags)[(Flag)(V172 + blockNum)] + 5, 0);
 	digi_play("507_s93", 2);
 
-	_G(flags)[V172 + blockNum] += 4;
-	if (_G(flags)[V172 + blockNum] > 16)
-		_G(flags)[V172 + blockNum] = 0;
+	_G(flags)[(Flag)(V172 + blockNum)] += 4;
+	if (_G(flags)[(Flag)(V172 + blockNum)] > 16)
+		_G(flags)[(Flag)(V172 + blockNum)] = 0;
 }
 
 } // namespace Rooms
diff --git a/engines/m4/riddle/rooms/section6/room603.cpp b/engines/m4/riddle/rooms/section6/room603.cpp
index 7b99e38d2e5..6ee50a611d5 100644
--- a/engines/m4/riddle/rooms/section6/room603.cpp
+++ b/engines/m4/riddle/rooms/section6/room603.cpp
@@ -75,7 +75,7 @@ void Room603::init() {
 			inv_player_has("PULL CORD") && !inv_object_is_here("POLE") &&
 			_G(flags)[V203] == 4) {
 		_G(flags)[V203] = 5;
-		_G(flags)[GLB_TEMP_5] = 0;
+		_G(flags)[V011] = 0;
 	}
 
 	if (_G(flags)[V191]) {
@@ -276,7 +276,7 @@ void Room603::init() {
 		break;
 	}
 
-	if (_G(flags)[GLB_TEMP_5])
+	if (_G(flags)[V011])
 		digi_play_loop("genrun", 3, 140, -1, 604);
 	else
 		digi_play_loop("950_s28a", 3, 90, -1, -1);
@@ -1495,7 +1495,7 @@ void Room603::parser() {
 		if (_G(flags)[V038])
 			_G(flags)[V039] = 1;
 
-		_G(flags)[GLB_TEMP_5] = 0;
+		_G(flags)[V011] = 0;
 		_G(game).setRoom(495);
 		_G(flags)[kTravelDest] = 4;
 	} else if (_G(kernel).trigger == 556) {
@@ -1506,7 +1506,7 @@ void Room603::parser() {
 		digi_unload("603_S02b");
 		digi_unload("603_S02c");
 
-		if (_G(flags)[GLB_TEMP_5]) {
+		if (_G(flags)[V011]) {
 			digi_stop(3);
 			digi_unload("genrun");
 			digi_preload("950_s28a");
@@ -2162,7 +2162,7 @@ void Room603::enter() {
 			_G(game).setRoom(604);
 			digi_stop(1);
 
-			if (_G(flags)[GLB_TEMP_5]) {
+			if (_G(flags)[V011]) {
 				adv_kill_digi_between_rooms(false);
 				digi_play_loop("genrun", 3, 140, -1, 604);
 			}
diff --git a/engines/m4/riddle/rooms/section6/room604.cpp b/engines/m4/riddle/rooms/section6/room604.cpp
index ff9c380a9b9..8ec2548fb67 100644
--- a/engines/m4/riddle/rooms/section6/room604.cpp
+++ b/engines/m4/riddle/rooms/section6/room604.cpp
@@ -137,7 +137,7 @@ void Room604::init() {
 
 		_shedDoor = series_show("SHED DOOR OPENS", 0xf00, 16);
 
-		if (_G(flags)[GLB_TEMP_5])
+		if (_G(flags)[V011])
 			digi_preload("genrun");
 		break;
 
@@ -167,7 +167,7 @@ void Room604::init() {
 	series_load("the generator cord");
 	_generatorCord = series_show_sprite("the generator cord", 0, 0xf00);
 
-	if (_G(flags)[GLB_TEMP_5])
+	if (_G(flags)[V011])
 		digi_play_loop("genrun", 3);
 }
 
@@ -306,13 +306,13 @@ void Room604::parser() {
 		} else {
 			digi_play_loop("genrun", 3);
 		}
-	} else if (useFlag && player_said("generator set") && _G(flags)[GLB_TEMP_5]) {
+	} else if (useFlag && player_said("generator set") && _G(flags)[V011]) {
 		digi_play("com115", 1, 255, -1, 997);
 	} else if (useFlag && (
 		(player_said("PULL CORD") && inv_object_is_here("PULL CORD")) ||
 		(player_said("generator set") && inv_object_is_here("PULL CORD"))
 	)) {
-		if (_G(flags)[GLB_TEMP_5]) {
+		if (_G(flags)[V011]) {
 			digi_play("com115", 1);
 		} else {
 			switch (_G(kernel).trigger) {
@@ -350,7 +350,7 @@ void Room604::parser() {
 					kernel_timing_trigger(180, 3);
 				} else {
 					player_set_commands_allowed(true);
-					_G(flags)[GLB_TEMP_5] = 1;
+					_G(flags)[V011] = 1;
 				}
 				break;
 
@@ -683,7 +683,7 @@ void Room604::parser() {
 			case 1:
 				adv_kill_digi_between_rooms(false);
 
-				if (_G(flags)[GLB_TEMP_5]) {
+				if (_G(flags)[V011]) {
 					digi_play_loop("genrun", 3);
 				} else {
 					digi_preload("950_s28");
diff --git a/engines/m4/riddle/rooms/section6/room608.cpp b/engines/m4/riddle/rooms/section6/room608.cpp
index c0b8f0e77bd..de729c9b4f4 100644
--- a/engines/m4/riddle/rooms/section6/room608.cpp
+++ b/engines/m4/riddle/rooms/section6/room608.cpp
@@ -1440,7 +1440,7 @@ void Room608::pre_parser() {
 	bool takeFlag = player_said("take");
 	bool useFlag = player_said_any("push", "pull", "gear", "open", "close");
 
-	if (player_said("HORN/PULL CORD", "WATER") && !_G(flags)[GLB_TEMP_3])
+	if (player_said("HORN/PULL CORD", "WATER") && !_G(flags)[V009])
 		_G(player).resetWalk();
 	if (player_said("POLE", "DRIFTWOOD STUMP ") && inv_player_has("POLE"))
 		_G(player).resetWalk();
@@ -1464,7 +1464,7 @@ void Room608::parser() {
 		_val3 = 1;
 		_val4 = 2;
 	} else if (talkFlag && player_said("old woman")) {
-		if (_G(flags)[GLB_TEMP_7]) {
+		if (_G(flags)[V013]) {
 			digi_play(_G(flags)[V203] > 2 ? "608r04" : "608r35", 1);
 		} else {
 			if (_G(flags)[V203] >= 2 || !_G(flags)[V034]) {
@@ -1713,7 +1713,7 @@ void Room608::parser() {
 			Common::strcpy_s(_G(player).verb, "lung");
 			kernel_timing_trigger(1, 1);
 		} else {
-			digi_play(_G(flags)[GLB_TEMP_4] ? "608r04a" : "608r35a", 1);
+			digi_play(_G(flags)[V010] ? "608r04a" : "608r35a", 1);
 		}
 	} else if (player_said("clock facing", "old woman") &&
 			!inv_object_is_here("OBSIDIAN DISK")) {
@@ -1721,7 +1721,7 @@ void Room608::parser() {
 			Common::strcpy_s(_G(player).verb, "prostate");
 			kernel_timing_trigger(1, 1);
 		} else {
-			digi_play(_G(flags)[GLB_TEMP_4] ? "608r04a" : "608r35a", 1);
+			digi_play(_G(flags)[V010] ? "608r04a" : "608r35a", 1);
 		}
 	} else if (player_said_any("bowels", "scrotum")) {
 		switch (_G(kernel).trigger) {
@@ -1894,7 +1894,7 @@ void Room608::conv608a() {
 				_val3 = 5;
 		} else if (who == 1) {
 			if (node == 4)
-				_G(flags)[GLB_TEMP_7] = 1;
+				_G(flags)[V013] = 1;
 			if (!(node == 5 && entry == 3))
 				_val4 = 1;
 		}
@@ -2117,7 +2117,7 @@ bool Room608::hornCordWater() {
 			series_unload(_horn);
 			terminateMachineAndNull(_shadow5);
 			ws_unhide_walker();
-			_G(flags)[GLB_TEMP_3] = 1;
+			_G(flags)[V009] = 1;
 			player_set_commands_allowed(true);
 			digi_play("608r65", 1);
 			return true;
diff --git a/engines/m4/riddle/rooms/section6/room610.cpp b/engines/m4/riddle/rooms/section6/room610.cpp
index 0f37f7b99b1..1ca5fbb54cd 100644
--- a/engines/m4/riddle/rooms/section6/room610.cpp
+++ b/engines/m4/riddle/rooms/section6/room610.cpp
@@ -64,7 +64,7 @@ void Room610::init() {
 	_sgSlapsTt2 = series_load("SG SLAPS TT AGAIN");
 	_sgPullsGun = series_load("SG PULLS A GUN");
 
-	if (_G(flags)[GLB_TEMP_6]) {
+	if (_G(flags)[V012]) {
 		hotspot_set_active("window", false);
 		series_show("610 shed window open", 0xf00, 16);
 	} else {
@@ -645,7 +645,7 @@ void Room610::useWindow() {
 	case -1:
 		player_set_commands_allowed(false);
 
-		if (_G(flags)[GLB_TEMP_6]) {
+		if (_G(flags)[V012]) {
 			kernel_timing_trigger(1, 1);
 		} else {
 			ws_hide_walker();
@@ -666,7 +666,7 @@ void Room610::useWindow() {
 		digi_play("610_s01", 2);
 		hotspot_set_active("window", false);
 		hotspot_set_active("window ", true);
-		_G(flags)[GLB_TEMP_6] = 1;
+		_G(flags)[V012] = 1;
 		break;
 
 	case 4:
diff --git a/engines/m4/riddle/rooms/section8/room802.cpp b/engines/m4/riddle/rooms/section8/room802.cpp
index f8f92b673c8..7e4788d1afe 100644
--- a/engines/m4/riddle/rooms/section8/room802.cpp
+++ b/engines/m4/riddle/rooms/section8/room802.cpp
@@ -305,7 +305,7 @@ void Room802::parser() {
 			_handInWallMach = series_place_sprite("HAND IN WALL", 0, 0, 0, 100, 512);
 			series_unload(_ripDragsSack);
 			series_unload(_sackAgainstWall);
-			_G(flags)[253] = 1;
+			_G(flags)[V253] = 1;
 			hotspot_set_active(_G(currentSceneDef).hotspots, "rice sack", false);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "rice sack ", true);
 			hotspot_set_active(_G(currentSceneDef).hotspots, "hand", true);
@@ -324,7 +324,7 @@ void Room802::parser() {
 		}
 	}
 
-	else if ((player_said("farmer's shovel", "hand") || player_said("farmer's shovel", "wall")) && _G(flags)[254] == 0) {
+	else if ((player_said("farmer's shovel", "hand") || player_said("farmer's shovel", "wall")) && _G(flags)[V254] == 0) {
 		if (_G(flags)[V253]) {
 			switch (_G(kernel).trigger) {
 			case -1:
diff --git a/engines/m4/riddle/rooms/section8/room806.cpp b/engines/m4/riddle/rooms/section8/room806.cpp
index c509c627ed1..8771905ae59 100644
--- a/engines/m4/riddle/rooms/section8/room806.cpp
+++ b/engines/m4/riddle/rooms/section8/room806.cpp
@@ -266,13 +266,13 @@ void Room806::pre_parser() {
 		_G(player).waiting_for_walk = false;
 	}
 
-	if (player_said_any("    ", "      ") && _G(flags)[266] == 0) {
+	if (player_said_any("    ", "      ") && _G(flags)[V266] == 0) {
 		_G(player).need_to_walk = false;
 		_G(player).ready_to_walk = true;
 		_G(player).waiting_for_walk = false;
 	}
 
-	if (player_said_any("    ", "      ") && _G(flags)[266] != 0 && !walkFl && !player_said("east")) {
+	if (player_said_any("    ", "      ") && _G(flags)[V266] != 0 && !walkFl && !player_said("east")) {
 		_G(player).need_to_walk = false;
 		_G(player).ready_to_walk = true;
 		_G(player).waiting_for_walk = false;
@@ -302,14 +302,14 @@ void Room806::pre_parser() {
 		_G(player).waiting_for_walk = false;
 	}
 
-	if (player_said("west") && _G(flags)[276] == 0) {
+	if (player_said("west") && _G(flags)[V276] == 0) {
 		sendWSMessage_10000(_mcTrekMach, 225, 306, 9, -1, 1);
 		_unkVar3 = 1;
 		hotspot_set_active(_G(currentSceneDef).hotspots, "MEI CHEN", true);
 		hotspot_set_active(_G(currentSceneDef).hotspots, "MEI CHEN ", false);
 	}
 
-	if (player_said("east") && _G(flags)[266] && _G(flags)[276] == 0) {
+	if (player_said("east") && _G(flags)[V266] && _G(flags)[V276] == 0) {
 		sendWSMessage_10000(_mcTrekMach, 624, 306, 3, -1, 1);
 		_unkVar3 = 0;
 		hotspot_set_active(_G(currentSceneDef).hotspots, "MEI CHEN", false);
@@ -1022,7 +1022,7 @@ void Room806::parser() {
 	else if (!gearFl && player_said_any("MEI CHEN", "MEI CHEN "))
 		digi_play("com017", 1, 255, 997);
 
-	else if (((walkFl && player_said("    ")) || (!walkFl && player_said("east"))) && _G(flags)[266] == 0) {
+	else if (((walkFl && player_said("    ")) || (!walkFl && player_said("east"))) && _G(flags)[V266] == 0) {
 		switch (_G(kernel).trigger) {
 		case -1:
 			_G(player).disable_hyperwalk = true;
@@ -1081,7 +1081,7 @@ void Room806::parser() {
 		default:
 			break;
 		}
-	} // if (((walkFl && player_said("    ")) || (!walkFl && player_said("east"))) && _G(flags)[266] == 0)
+	} // if (((walkFl && player_said("    ")) || (!walkFl && player_said("east"))) && _G(flags)[V266] == 0)
 
 	else if (player_said("west") && (_G(kernel).trigger == -1 || _G(kernel).trigger == 1)) {
 		if (_G(kernel).trigger == -1) {
@@ -1192,8 +1192,8 @@ void Room806::daemon() {
 		break;
 
 	case 117:
-		_G(flags)[265] = 1;
-		_G(flags)[256] = 1;
+		_G(flags)[V265] = 1;
+		_G(flags)[V256] = 1;
 		series_unload(_806rp01Series);
 		series_unload(_806mc01Series);
 		digi_unload("806m01");
@@ -1241,7 +1241,7 @@ void Room806::daemon() {
 			else if (_G(player_info).facing > 5 && _G(player_info).facing <= 11)
 				ws_walk(_G(my_walker), _G(player_info).x, _G(player_info).y, nullptr, 205, 9, true);
 
-		} else if (_G(flags)[269])
+		} else if (_G(flags)[V269])
 			kernel_timing_trigger(60, 201, nullptr);
 
 		break;
@@ -1518,7 +1518,7 @@ void Room806::daemon() {
 		terminateMachine(_806ChartMach);
 		_806ChartMach = series_show("806chart", 3840, 16, -1, -1, 0, 100, 0, 0);
 
-		if (_G(flags)[265])
+		if (_G(flags)[V265])
 			sendWSMessage_10000(_mcTrekMach, 225, 306, 3, -1, 1);
 		else
 			sendWSMessage_10000(_mcTrekMach, 225, 306, 3, 101, 1);
@@ -1553,7 +1553,7 @@ void Room806::daemon() {
 		break;
 
 	case 999:
-		if (_G(flags)[265]) {
+		if (_G(flags)[V265]) {
 			player_set_commands_allowed(true);
 			_unkVar1 = 0;
 		}
diff --git a/engines/m4/riddle/vars.cpp b/engines/m4/riddle/vars.cpp
index 86bbbfbf724..df894261ce2 100644
--- a/engines/m4/riddle/vars.cpp
+++ b/engines/m4/riddle/vars.cpp
@@ -81,7 +81,7 @@ void Vars::initialize_game() {
 	_G(flags)[V071] = 2;
 	_G(flags)[V088] = 1;
 	_G(flags)[V086] = 2;
-	_G(flags)[GLB_TEMP_8] = 1;
+	_G(flags)[V014] = 1;
 	_G(flags)[V270] = 824;
 	_G(flags)[V282] = 1;
 	_G(flags)[V292] = 1;




More information about the Scummvm-git-logs mailing list