Make the fix for #4730 more targetted.
Fixes #4936 by only adding the timestamp to the replay's filename rather than *all* save filenames.
This commit is contained in:
parent
15c070b865
commit
5dcda03ee9
1 changed files with 5 additions and 6 deletions
|
@ -452,11 +452,6 @@ bool savegame::save_game(const std::string& filename)
|
|||
if (filename_.empty())
|
||||
filename_ = filename;
|
||||
|
||||
time_t t = std::time(nullptr);
|
||||
tm tm = *std::localtime(&t);
|
||||
auto time = std::put_time(&tm, "%Y%m%d-%H%M%S");
|
||||
filename_ = (formatter() << filename_ << '_' << time).str();
|
||||
|
||||
before_save();
|
||||
|
||||
write_game_to_disk(filename_);
|
||||
|
@ -568,8 +563,12 @@ replay_savegame::replay_savegame(saved_game &gamestate, const compression::forma
|
|||
|
||||
std::string replay_savegame::create_initial_filename(unsigned int) const
|
||||
{
|
||||
time_t t = std::time(nullptr);
|
||||
tm tm = *std::localtime(&t);
|
||||
auto time = std::put_time(&tm, "%Y%m%d-%H%M%S");
|
||||
|
||||
// TRANSLATORS: This string is used as part of a filename, as in, "HttT-The Elves Besieged replay.gz"
|
||||
return formatter() << gamestate().classification().label << " " << _("replay");
|
||||
return formatter() << gamestate().classification().label << " " << _("replay") << " " << time;
|
||||
}
|
||||
|
||||
void replay_savegame::write_game(config_writer &out) {
|
||||
|
|
Loading…
Add table
Reference in a new issue