Allow setting autosave interval to a custom number of days
This commit is contained in:
@@ -249,7 +249,7 @@ static void OnNewYear()
|
||||
*/
|
||||
static void OnNewMonth()
|
||||
{
|
||||
if (_settings_client.gui.autosave != 0 && (_cur_date_ymd.month % _autosave_months[_settings_client.gui.autosave]) == 0) {
|
||||
if (_settings_client.gui.autosave != 0 && _settings_client.gui.autosave < 5 && (_cur_date_ymd.month % _autosave_months[_settings_client.gui.autosave]) == 0) {
|
||||
_do_autosave = true;
|
||||
_check_special_modes = true;
|
||||
SetWindowDirty(WC_STATUS_BAR, 0);
|
||||
@@ -271,6 +271,12 @@ static void OnNewMonth()
|
||||
*/
|
||||
static void OnNewDay()
|
||||
{
|
||||
if (_settings_client.gui.autosave == 5 && (_date % _settings_client.gui.autosave_custom_days) == 0) {
|
||||
_do_autosave = true;
|
||||
_check_special_modes = true;
|
||||
SetWindowDirty(WC_STATUS_BAR, 0);
|
||||
}
|
||||
|
||||
if (!_newgrf_profilers.empty() && _newgrf_profile_end_date <= _date) {
|
||||
NewGRFProfiler::FinishAll();
|
||||
}
|
||||
|
Reference in New Issue
Block a user