From d4910281f89c2515812e1b4f3d2be71d022ceca0 Mon Sep 17 00:00:00 2001 From: Beha Date: Wed, 16 Jun 2021 11:43:36 -0400 Subject: Do not open elevator formspec when holding elevator component. Closes #14. --- components.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'components.lua') diff --git a/components.lua b/components.lua index 8ebe5f9..649e5f6 100644 --- a/components.lua +++ b/components.lua @@ -300,6 +300,14 @@ for _,mode in ipairs({"on", "off"}) do if not sender or not sender:is_player() then return end + -- Don't do anything when the player is holding elevator components. + if ({ + ["elevator:elevator_off"] = true, + ["elevator:shaft"] = true, + ["elevator:motor"] = true, + })[sender:get_wielditem():get_name()] then + return + end local formspec local meta = minetest.get_meta(pos) elevator.formspecs[sender:get_player_name()] = {pos} -- cgit v1.2.3