1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 00:42:45 +01:00

Codechange: Use EnumBitSet for PauseMode. (#13553)

This commit is contained in:
Peter Nelson
2025-02-14 08:30:04 +00:00
committed by GitHub
parent 3518d7e0f1
commit 6cf7a899e9
27 changed files with 113 additions and 118 deletions

View File

@@ -1081,7 +1081,7 @@ struct ScriptDebugWindow : public Window {
}
/* If the last AI/Game Script is unpaused, unpause the game too. */
if ((_pause_mode & PM_PAUSED_NORMAL) == PM_PAUSED_NORMAL) {
if (_pause_mode.Test(PauseMode::Normal)) {
bool all_unpaused = !Game::IsPaused();
if (all_unpaused) {
for (const Company *c : Company::Iterate()) {
@@ -1092,7 +1092,7 @@ struct ScriptDebugWindow : public Window {
}
if (all_unpaused) {
/* All scripts have been unpaused => unpause the game. */
Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, false);
Command<CMD_PAUSE>::Post(PauseMode::Normal, false);
}
}
}
@@ -1144,8 +1144,8 @@ struct ScriptDebugWindow : public Window {
}
/* Pause the game. */
if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) {
Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, true);
if (!_pause_mode.Test(PauseMode::Normal)) {
Command<CMD_PAUSE>::Post(PauseMode::Normal, true);
}
/* Highlight row that matched */