Helper function to restart the map. */
| 1811 | |
| 1812 | /** Helper function to restart the map. */ |
| 1813 | static 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. */ |
| 1832 | static IntervalTimer<TimerGameRealtime> _network_restart_map_timer({std::chrono::hours::zero(), TimerGameRealtime::UNPAUSED}, [](auto) |
no outgoing calls
no test coverage detected