diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 02:12:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 02:15:16 +0100 |
commit | 94c531bd05ab6b49996113faff9584cb6b534b9c (patch) | |
tree | 273aae5c8ee1f8c2801a2c5ca05ca52422e49a35 /editor | |
parent | 703c19301f2e93fb59b468bdd635a9cc763fad3f (diff) |
loader: chdir to share/floormat
Diffstat (limited to 'editor')
-rw-r--r-- | editor/save.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/save.cpp b/editor/save.cpp index 6d79bfce..80274875 100644 --- a/editor/save.cpp +++ b/editor/save.cpp @@ -1,16 +1,18 @@ #include "app.hpp" #include "floormat/main.hpp" #include "src/world.hpp" +#include "loader/loader.hpp" #include <Corrade/Utility/Path.h> namespace floormat { -#define save_dir "../save" +#define save_dir "save" #define quicksave_file save_dir "/" "quicksave.dat" #define quicksave_tmp save_dir "/" "quicksave.tmp" static bool ensure_save_directory() { + auto dir = Path::join(loader.TEMP_PATH, save_dir); if (Path::make(save_dir)) return true; else @@ -36,16 +38,17 @@ void app::do_quicksave() void app::do_quickload() { + auto file = Path::join(loader.TEMP_PATH, quicksave_file); kill_popups(true); if (!ensure_save_directory()) return; - if (!Path::exists(quicksave_file)) + if (!Path::exists(file)) { fm_warn("no quicksave"); return; } fputs("quickload... ", stderr); fflush(stderr); - reset_world(world::deserialize(quicksave_file)); + reset_world(world::deserialize(file)); fputs("done\n", stderr); fflush(stderr); } |