From c63396cca734a129f7d643d3f5c2d37545791206 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2024 04:59:11 +0100 Subject: [PATCH] dd --- editor/scenery-editor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp index 32ddffa1..07cdbd7c 100644 --- a/editor/scenery-editor.cpp +++ b/editor/scenery-editor.cpp @@ -1,7 +1,6 @@ #include "scenery-editor.hpp" #include "src/anim-atlas.hpp" #include "loader/loader.hpp" -#include "compat/assert.hpp" #include "src/world.hpp" #include "src/RTree-search.hpp" #include "src/rotation.inl" @@ -89,16 +88,15 @@ void scenery_editor::place_tile(world& w, global_coords pos, const scenery_& s, auto [c, t] = w[pos]; start: const auto& es = c.objects(); + const auto sz = es.size(); while (auto id = a.get_object_colliding_with_cursor()) { - for (auto i = es.size()-1; i != (size_t)-1; i--) - { + for (auto i = 0uz; i < sz; i++) if (es[i]->id == id) { c.remove_object(i); goto start; } - } break; } }