This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user