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

Function NetworkCheckRestartMapYear

src/network/network_server.cpp:1855–1864  ·  view source on GitHub ↗

Check if we want to restart the map based on the year. */

Source from the content-addressed store, hash-verified

1853
1854/** Check if we want to restart the map based on the year. */
1855static 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. */
1867static const IntervalTimer<TimerGameCalendar> _calendar_network_yearly({ TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE }, [](auto) {

Callers 1

network_server.cppFile · 0.85

Calls 1

NetworkRestartMapFunction · 0.85

Tested by

no test coverage detected