summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 09:40:53 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 09:40:53 +0100
commit183e3deaea2dbfc09bf8a189e05ba7ba0fc2a369 (patch)
tree75eb74e80804a3019dd0a08132864e36ab7caf2d /editor
parent6ec5e5aaf44693f44a4f19d0d394cd8a4c114fa2 (diff)
editor: fix quicksave
Diffstat (limited to 'editor')
-rw-r--r--editor/save.cpp10
1 files 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);
}