From 82d4063e1d9dbf7eb0908d42cb13958aa884dc05 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 12:36:43 +0100 Subject: editor: fix crash on entity::move_to onto another chunk --- editor/update.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/editor/update.cpp b/editor/update.cpp index 05226f60..4f7b517a 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -186,9 +186,8 @@ void app::update_world(float dt) { auto& c = world[chunk_coords{x, y}]; const auto& es = c.entities(); - const auto size = es.size(); - -start: for (auto i = size-1; i != (size_t)-1; i--) +start: const auto size = es.size(); + for (auto i = size-1; i != (size_t)-1; i--) { auto& e = *es[i]; fm_debug_assert(!(e.last_update > curframe)); -- cgit v1.2.3