Allow unpausing upstream savegames using PM_COMMAND_DURING_PAUSE

pull/595/head
Jonathan G Rennison 9 months ago
parent 428e1c364e
commit 80fa53bc58

@ -184,6 +184,11 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2,
if ((p2 & 1) == 0) {
_pause_mode = static_cast<PauseMode>(_pause_mode & (byte)~p1);
_pause_countdown = (p2 >> 1);
/* If the only remaining reason to be paused is that we saw a command during pause, unpause. */
if (_pause_mode == PM_COMMAND_DURING_PAUSE) {
_pause_mode = PM_UNPAUSED;
}
} else {
_pause_mode = static_cast<PauseMode>(_pause_mode | (byte)p1);
}

@ -75,6 +75,7 @@ enum PauseMode : byte {
PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, ///< A game paused for 'min_active_clients'
PM_PAUSED_GAME_SCRIPT = 1 << 5, ///< A game paused by a game script
PM_PAUSED_LINK_GRAPH = 1 << 6, ///< A game paused due to the link graph schedule lagging
PM_COMMAND_DURING_PAUSE = 1 << 7, ///< A game paused, and a command executed during the pause; resets on autosave
/** Pause mode bits when paused for network reasons. */
PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,

Loading…
Cancel
Save