From 25749f7d527a1545b81f23cc461e6f6fbcb362aa Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 9 Apr 2023 18:30:44 +0200 Subject: editor: fix activating non-interactive entities --- editor/update.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/update.cpp b/editor/update.cpp index 41e5fde4..630d1397 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -68,7 +68,11 @@ void app::do_mouse_up_down(uint8_t button, bool is_down, int mods) if (button == mouse_button_left) { if (auto* cl = find_clickable_scenery(*cursor.pixel)) - return (void)cl->e->activate(cl->e->index()); + { + auto& e = *cl->e; + const auto i = e.index(); + return e.can_activate(i) ? (void)e.activate(i) : void(); + } } // TODO it should open on mouseup if still on the same item as on mousedown else if (button == mouse_button_right) -- cgit v1.2.3