summaryrefslogtreecommitdiffhomepage
path: root/editor/draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/draw.cpp')
-rw-r--r--editor/draw.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 6d07f871..285299b6 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -80,9 +80,10 @@ void app::draw_collision_boxes()
for (int16_t x = minx; x <= maxx; x++)
{
const chunk_coords pos{x, y};
- auto& c = world[pos];
- if (c.empty())
+ auto* c_ = world.at(pos);
+ if (!c_)
continue;
+ auto& c = *c_;
c.ensure_passability();
const with_shifted_camera_offset o{shader, pos, {minx, miny}, {maxx, maxy}};
if (floormat_main::check_chunk_visible(shader.camera_offset(), sz))
@@ -116,9 +117,10 @@ void app::draw_collision_boxes()
for (int16_t x = minx; x <= maxx; x++)
{
const chunk_coords c_pos{x, y};
- auto& c = world[c_pos];
- if (c.empty())
+ auto* c_ = world.at(c_pos);
+ if (!c_)
continue;
+ auto& c = *c_;
c.ensure_passability();
const with_shifted_camera_offset o{shader, c_pos, {minx, miny}, {maxx, maxy}};
if (floormat_main::check_chunk_visible(shader.camera_offset(), sz))