From 183e3deaea2dbfc09bf8a189e05ba7ba0fc2a369 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Mar 2023 09:40:53 +0100 Subject: editor: fix quicksave --- editor/save.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/editor/save.cpp b/editor/save.cpp index 80274875..0d78ae66 100644 --- a/editor/save.cpp +++ b/editor/save.cpp @@ -24,15 +24,17 @@ static bool ensure_save_directory() void app::do_quicksave() { + auto file = Path::join(loader.TEMP_PATH, quicksave_file); + auto tmp = Path::join(loader.TEMP_PATH, quicksave_tmp); if (!ensure_save_directory()) return; auto& world = M->world(); world.collect(true); - if (Path::exists(quicksave_tmp)) - Path::remove(quicksave_tmp); + if (Path::exists(tmp)) + Path::remove(tmp); fputs("quicksave... ", stderr); fflush(stderr); - world.serialize(quicksave_tmp); - Path::move(quicksave_tmp, quicksave_file); + world.serialize(tmp); + Path::move(tmp, file); fputs("done\n", stderr); fflush(stderr); } -- cgit v1.2.3