summaryrefslogtreecommitdiffhomepage
path: root/editor/update.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/update.cpp')
-rw-r--r--editor/update.cpp6
1 files changed, 5 insertions, 1 deletions
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)