* Create an autosave or netsave. * @param counter A reference to the counter variable to be used for rotating the file name. * @param netsave Indicates if this is a regular autosave or a netsave. */
| 3347 | * @param netsave Indicates if this is a regular autosave or a netsave. |
| 3348 | */ |
| 3349 | void DoAutoOrNetsave(FiosNumberedSaveName &counter) |
| 3350 | { |
| 3351 | std::string filename; |
| 3352 | |
| 3353 | if (_settings_client.gui.keep_all_autosave) { |
| 3354 | filename = GenerateDefaultSaveName() + counter.Extension(); |
| 3355 | } else { |
| 3356 | filename = counter.Filename(); |
| 3357 | } |
| 3358 | |
| 3359 | Debug(sl, 2, "Autosaving to '{}'", filename); |
| 3360 | if (SaveOrLoad(filename, SLO_SAVE, DFT_GAME_FILE, AUTOSAVE_DIR) != SL_OK) { |
| 3361 | ShowErrorMessage(GetEncodedString(STR_ERROR_AUTOSAVE_FAILED), {}, WL_ERROR); |
| 3362 | } |
| 3363 | } |
| 3364 | |
| 3365 | |
| 3366 | /** Do a save when exiting the game (_settings_client.gui.autosave_on_exit) */ |
no test coverage detected