diff options
author | Stephan <5377412+Taschi120@users.noreply.github.com> | 2021-07-09 21:44:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 21:44:02 +0200 |
commit | a70aa5df4938a6a4459690c4666a5c39a3f5bf98 (patch) | |
tree | b5296b3077a2268dda8394bfc0745dac81d3345a /src/openttd.cpp | |
parent | ce813ce644c58bbf07509eb8c409ec60512deaf0 (diff) | |
download | openttd-a70aa5df4938a6a4459690c4666a5c39a3f5bf98.tar.xz |
Add #9188: netsave now keeps multiple version around, similar to autosave (#9395)
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index aba1ae986..904cdbbb1 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1392,24 +1392,8 @@ void StateGameLoop() */ static void DoAutosave() { - char buf[MAX_PATH]; - - if (_settings_client.gui.keep_all_autosave) { - GenerateDefaultSaveName(buf, lastof(buf)); - strecat(buf, ".sav", lastof(buf)); - } else { - static int _autosave_ctr = 0; - - /* generate a savegame name and number according to _settings_client.gui.max_num_autosaves */ - seprintf(buf, lastof(buf), "autosave%d.sav", _autosave_ctr); - - if (++_autosave_ctr >= _settings_client.gui.max_num_autosaves) _autosave_ctr = 0; - } - - Debug(sl, 2, "Autosaving to '{}'", buf); - if (SaveOrLoad(buf, SLO_SAVE, DFT_GAME_FILE, AUTOSAVE_DIR) != SL_OK) { - ShowErrorMessage(STR_ERROR_AUTOSAVE_FAILED, INVALID_STRING_ID, WL_ERROR); - } + static int _autosave_ctr = 0; + DoAutoOrNetsave(_autosave_ctr); } /** |