From c8c86c776483a60b988b18257573009b9897fd6c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2024 04:46:10 +0100 Subject: editor: fix crash on deleting multiple scenery at once --- editor/scenery-editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp index 40742c8a..32ddffa1 100644 --- a/editor/scenery-editor.cpp +++ b/editor/scenery-editor.cpp @@ -87,8 +87,9 @@ void scenery_editor::place_tile(world& w, global_coords pos, const scenery_& s, if (!s) { auto [c, t] = w[pos]; +start: const auto& es = c.objects(); -start: while (auto id = a.get_object_colliding_with_cursor()) + while (auto id = a.get_object_colliding_with_cursor()) { for (auto i = es.size()-1; i != (size_t)-1; i--) { -- cgit v1.2.3