MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MakeNewGameDone

Function MakeNewGameDone

src/openttd.cpp:860–898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860static void MakeNewGameDone()
861{
862 SettingsDisableElrail(_settings_game.vehicle.disable_elrails);
863
864 /* In a dedicated server, the server does not play */
865 if (!VideoDriver::GetInstance()->HasGUI()) {
866 OnStartGame(true);
867 if (_settings_client.gui.pause_on_newgame) Command<CMD_PAUSE>::Post(PauseMode::Normal, true);
868 return;
869 }
870
871 /* Create a single company */
872 DoStartupNewCompany(false);
873
874 Company *c = Company::Get(CompanyID::Begin());
875 c->settings = _settings_client.company;
876
877 /* Overwrite colour from settings if needed
878 * COLOUR_END corresponds to Random colour */
879
880 if (_settings_client.gui.starting_colour != COLOUR_END) {
881 Command<CMD_SET_COMPANY_COLOUR>::Post(LS_DEFAULT, true, _settings_client.gui.starting_colour);
882 }
883
884 if (_settings_client.gui.starting_colour_secondary != COLOUR_END && HasBit(_loaded_newgrf_features.used_liveries, LS_DEFAULT)) {
885 Command<CMD_SET_COMPANY_COLOUR>::Post(LS_DEFAULT, false, _settings_client.gui.starting_colour_secondary);
886 }
887
888 OnStartGame(false);
889
890 InitializeRailGUI();
891 InitializeRoadGUI();
892
893 if (_settings_client.gui.pause_on_newgame) Command<CMD_PAUSE>::Post(PauseMode::Normal, true);
894
895 CheckEngines();
896 CheckIndustries();
897 MarkWholeScreenDirty();
898}
899
900static void MakeNewGame(bool from_heightmap, bool reset_settings)
901{

Callers

nothing calls this directly

Calls 11

SettingsDisableElrailFunction · 0.85
OnStartGameFunction · 0.85
DoStartupNewCompanyFunction · 0.85
BeginFunction · 0.85
HasBitFunction · 0.85
InitializeRailGUIFunction · 0.85
InitializeRoadGUIFunction · 0.85
CheckEnginesFunction · 0.85
CheckIndustriesFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85
HasGUIMethod · 0.45

Tested by

no test coverage detected