summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-09 12:14:15 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-09 12:14:25 +0100
commitd5855147847d62d116359b560aa1f80b3691feb5 (patch)
treea0ef58c2dc116e684f2ed97ca757155461e7c3cb
parentf4a9ab08a06c751ca1464859b441d11bc5debc93 (diff)
mark chunk as modified when modifying it
-rw-r--r--editor/tile-editor.cpp1
-rw-r--r--editor/update.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp
index 8df82609..6e4da967 100644
--- a/editor/tile-editor.cpp
+++ b/editor/tile-editor.cpp
@@ -147,6 +147,7 @@ tile_image_proto tile_editor::get_selected()
void tile_editor::place_tile(world& world, global_coords pos, const tile_image_proto& img)
{
auto [c, t] = world[pos];
+ c.mark_modified();
switch (_mode)
{
case editor_mode::none:
diff --git a/editor/update.cpp b/editor/update.cpp
index 36a872c5..53915908 100644
--- a/editor/update.cpp
+++ b/editor/update.cpp
@@ -29,8 +29,8 @@ void app::maybe_initialize_chunk_(const chunk_coords& pos, chunk& c)
c[{K, K }].wall_west() = { _wall2, 0 };
c[{K, K+1}].wall_north() = { _wall1, 0 };
c[{K+1, K }].wall_west() = { _wall2, 0 };
- //c[{K+1, K+1}].scenery() = { _door, {rotation::N, 0} };
- //c.mark_modified();
+ c[{K+1, K+1}].scenery() = { _door, {rotation::N, 0} };
+ c.mark_modified();
}
void app::maybe_initialize_chunk([[maybe_unused]] const chunk_coords& pos, [[maybe_unused]] chunk& c)