diff options
Diffstat (limited to 'editor/draw.cpp')
| -rw-r--r-- | editor/draw.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp index 9060f865..aa8cc5f0 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -20,6 +20,7 @@ void app::draw_cursor() { constexpr float LINE_WIDTH = 2; auto& shader = M->shader(); + auto& w = M->world(); const auto inactive_color = 0xff00ffff_rgbaf; if (cursor.tile && !cursor.in_imgui) @@ -56,6 +57,9 @@ void app::draw_cursor() auto [_f, _w, anim_mesh] = M->meshes(); const auto offset = Vector3i(Vector2i(sel.offset), 0); const auto pos = cursor.tile->to_signed3()*iTILE_SIZE + offset; + auto [ch, t] = w[*cursor.tile]; + if (!ch.can_place_entity(sel, cursor.tile->local())) + shader.set_tint({1, 0, 1, 0.5f}); anim_mesh.draw(shader, *sel.atlas, sel.r, sel.frame, Vector3(pos), 1); } } |
