summaryrefslogtreecommitdiffhomepage
path: root/editor/update.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-06 15:29:33 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-06 15:29:33 +0200
commit82ec1a07c79b1c96688464609d043d6ce23685b1 (patch)
tree90473a42d3799bafb4fd9fd2a23f779bf36770db /editor/update.cpp
parent9703532543d528757e4635f0eb5c91ccb4c2e300 (diff)
a
Diffstat (limited to 'editor/update.cpp')
-rw-r--r--editor/update.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/update.cpp b/editor/update.cpp
index 069399c7..eb4029dc 100644
--- a/editor/update.cpp
+++ b/editor/update.cpp
@@ -185,7 +185,10 @@ void app::update_world(float dt)
for (int16_t y = miny; y <= maxy; y++)
for (int16_t x = minx; x <= maxx; x++)
{
- auto& c = world[chunk_coords{x, y}];
+ auto* c_ = world.at(chunk_coords{x, y});
+ if (!c_)
+ continue;
+ auto& c = *c_;
const auto& es = c.entities();
start: const auto size = es.size();
for (auto i = size-1; i != (size_t)-1; i--)