diff --git a/src/openttd.cpp b/src/openttd.cpp --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -66,6 +66,7 @@ #include "framerate_type.h" #include "industry.h" #include "network/network_gui.h" +#include "misc_cmd.h" #include "linkgraph/linkgraphschedule.h" @@ -851,7 +852,7 @@ static void MakeNewGameDone() /* In a dedicated server, the server does not play */ if (!VideoDriver::GetInstance()->HasGUI()) { OnStartGame(true); - if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); return; } @@ -880,7 +881,7 @@ static void MakeNewGameDone() NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass); } - if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); CheckEngines(); CheckIndustries(); @@ -1045,7 +1046,7 @@ void SwitchToMode(SwitchMode new_mode) } OnStartGame(_network_dedicated); /* Decrease pause counter (was increased from opening load dialog) */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); + Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); } break; } @@ -1067,7 +1068,7 @@ void SwitchToMode(SwitchMode new_mode) SetLocalCompany(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; /* Cancel the saveload pausing */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); + Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); } else { SetDParamStr(0, GetSaveLoadErrorString()); ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);