Check if we want to restart the map based on the year. */
| 1853 | |
| 1854 | /** Check if we want to restart the map based on the year. */ |
| 1855 | static void NetworkCheckRestartMapYear() |
| 1856 | { |
| 1857 | /* If setting is 0, this feature is disabled. */ |
| 1858 | if (_settings_client.network.restart_game_year == 0) return; |
| 1859 | |
| 1860 | if (TimerGameCalendar::year >= _settings_client.network.restart_game_year) { |
| 1861 | Debug(net, 3, "Auto-restarting map: year {} reached", TimerGameCalendar::year); |
| 1862 | NetworkRestartMap(); |
| 1863 | } |
| 1864 | } |
| 1865 | |
| 1866 | /** Calendar yearly "callback". Called whenever the calendar year changes. */ |
| 1867 | static const IntervalTimer<TimerGameCalendar> _calendar_network_yearly({ TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE }, [](auto) { |
no test coverage detected