diff --git a/data/maps/pyramid.yaml b/data/maps/pyramid.yaml index 8fe8e16..91d2c4c 100644 --- a/data/maps/pyramid.yaml +++ b/data/maps/pyramid.yaml @@ -32,18 +32,18 @@ geometry: data: - [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - [ 1,230,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,231, 1] - - [ 1,202,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,200, 1] - - [ 1,202, 32, 32, 2, 32, 32, 34, 34, 32, 32, 2, 32, 32, 32, 32, 34, 32, 32,200, 1] + - [ 1,202,292,260,292,292,260,292,292,260,292,292,260,292,260,292,292,260,260,200, 1] + - [ 1,202, 32, 32, 2, 32, 65, 34, 34, 32, 65, 2, 32, 32, 65, 32, 34, 32, 32,200, 1] - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 34, 2, 2, 2, 32,200, 1] - - [ 1,202, 32, 32, 32, 33, 33, 32, 32, 32, 32, 32, 2, 32, 32, 32, 34, 32, 32,200, 1] - - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 2, 2, 2, 2, 32, 2, 2, 2, 32,200, 1] - - [ 1,202, 32, 32, 33, 33, 32, 32, 32, 32, 32, 2, 32, 32, 34, 32, 32, 32, 32,200, 1] + - [ 1,202, 65, 32, 32, 33, 33, 32, 32, 32, 32, 32, 2, 32, 32, 32, 34, 32, 65,200, 1] - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32,200, 1] - - [ 1,202, 32, 32, 32, 32, 33, 33, 32, 32, 32, 32, 2, 32, 32, 32, 32, 32, 32,200, 1] + - [ 1,202, 65, 32, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 34, 32, 32, 32, 65,200, 1] - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32,200, 1] - - [ 1,202, 32, 32, 32, 2, 34, 32, 32, 32, 32, 2, 32, 33, 32, 32, 34, 32, 32,200, 1] + - [ 1,202, 65, 32, 32, 32, 33, 33, 32, 32, 32, 32, 2, 32,181, 32, 32, 32, 65,200, 1] - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32,200, 1] - - [ 1,202, 32, 32, 34, 34, 32, 32, 2, 32, 32, 32, 34, 33, 32, 32, 32, 32, 32,200, 1] + - [ 1,202, 65, 32, 33, 2, 34, 32, 32, 32, 32, 32, 32, 33, 32, 32, 34, 32, 65,200, 1] + - [ 1,202, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32, 2, 2, 2, 32,200, 1] + - [ 1,202, 32, 32, 34, 34, 65, 32, 2, 32, 65, 32, 34, 33, 65, 32, 32, 32, 32,200, 1] - [ 1,262,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,263, 1] # Spawns d'entitats per a aquest nivell. Es llegeixen des de diff --git a/source/game/editor/editor.cpp b/source/game/editor/editor.cpp index 416674a..85a13ac 100644 --- a/source/game/editor/editor.cpp +++ b/source/game/editor/editor.cpp @@ -12,6 +12,7 @@ #include "core/rendering/screen.hpp" #include "core/rendering/surface.hpp" #include "core/resources/resource_cache.hpp" +#include "core/resources/resource_helper.hpp" #include "core/system/event_buffer.hpp" #include "game/map/tilemap.hpp" #include "utils/defaults.hpp" @@ -75,7 +76,12 @@ void Editor::exit(Tilemap& tilemap) { if (!active_) { return; } active_ = false; picker_open_ = false; - const bool SAVED = tilemap.save(Defaults::Editor::SAVE_PATH); + // Resolem la ruta via Resource::Helper perquè en Debug el root de + // dades és AEE_SOURCE_DIR (ruta absoluta al repo), no el CWD. Sense + // això, el writer obriria `data/maps/pyramid.yaml` relatiu al CWD + // i fallaria sempre excepte si el binari es llança des del repo root. + const auto ABS_PATH = Resource::Helper::resolve(Defaults::Editor::SAVE_PATH); + const bool SAVED = tilemap.save(ABS_PATH); Notification::notify(Locale::get().text(SAVED ? "input.editor_off" : "input.editor_save_error")); }