summaryrefslogtreecommitdiffhomepage
path: root/editor/update.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-21 12:36:43 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-21 12:36:43 +0100
commit82d4063e1d9dbf7eb0908d42cb13958aa884dc05 (patch)
treefc8062c9ecefa973bd29d0dfd0c9a7ac3debfe6a /editor/update.cpp
parenteff6b90e959d31b636d34ff94f59a2efe482f916 (diff)
editor: fix crash on entity::move_to onto another chunk
Diffstat (limited to 'editor/update.cpp')
-rw-r--r--editor/update.cpp5
1 files 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));