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

Function NetworkRestartMap

src/network/network_server.cpp:1813–1829  ·  view source on GitHub ↗

Helper function to restart the map. */

Source from the content-addressed store, hash-verified

1811
1812/** Helper function to restart the map. */
1813static void NetworkRestartMap()
1814{
1815 _settings_newgame.game_creation.generation_seed = GENERATE_NEW_SEED;
1816 switch (_file_to_saveload.ftype.abstract) {
1817 case FT_SAVEGAME:
1818 case FT_SCENARIO:
1819 _switch_mode = SM_LOAD_GAME;
1820 break;
1821
1822 case FT_HEIGHTMAP:
1823 _switch_mode = SM_START_HEIGHTMAP;
1824 break;
1825
1826 default:
1827 _switch_mode = SM_NEWGAME;
1828 }
1829}
1830
1831/** Timer to restart a network server automatically based on real-time hours played. Initialized at zero to disable until settings are loaded. */
1832static IntervalTimer<TimerGameRealtime> _network_restart_map_timer({std::chrono::hours::zero(), TimerGameRealtime::UNPAUSED}, [](auto)

Callers 2

network_server.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected