Change: base autosaves intervals on real time (instead of game time) (#10655)

There are two fundamental issues with autosave:
- When fast-forwarding, it saves way too often
- When paused, it never saves

Both makes no sense. Autosaves are meant to prevent you from
accidentally losing your work. The emphasis on "your" work.

To solve both issues, the autosave now works on real time. You
can select every 10 / 30 / 60 / 120 minutes, which are similar to
what the setting was in game-months.

When you pause, autosaving will stop. Unless you make any change
to the game; then it will continue to make autosaves, even so
the game is paused. Unpausing / pausing resets this mechanism.

(cherry picked from commit f5fad88723)
This commit is contained in:
Patric Stout
2023-04-27 17:21:29 +02:00
committed by Jonathan G Rennison
parent ec6cdce0c3
commit 19bbcb180d
8 changed files with 179 additions and 0 deletions

View File

@@ -100,5 +100,6 @@ bool RequestNewGRFScan(struct NewGRFScanCallback *callback = nullptr);
void GenerateSavegameId();
void OpenBrowser(const char *url);
void ChangeAutosaveFrequency(bool reset);
#endif /* OPENTTD_H */