diff options
Diffstat (limited to 'advtrains_interlocking/distant_ui.lua')
-rw-r--r-- | advtrains_interlocking/distant_ui.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/advtrains_interlocking/distant_ui.lua b/advtrains_interlocking/distant_ui.lua index 0907684..bb66dc4 100644 --- a/advtrains_interlocking/distant_ui.lua +++ b/advtrains_interlocking/distant_ui.lua @@ -56,6 +56,10 @@ local function init_signal_assignment(pname, pos) minetest.chat_send_player(pname, attrans("This operation is not allowed without the @1 privilege.", "interlocking")) return end + if not D.appropriate_signal(pos) then + minetest.chat_send_player(pname, attrans("Incompatible signal.")) + return + end signal_pos[pname] = pos minetest.chat_send_player(pname, attrans("Please punch the signal to use as the main signal.")) end @@ -66,6 +70,10 @@ local function init_distant_assignment(pname, pos) minetest.send_chat_player(pname, attrans("This operation is now allowed without the @1 privilege.", "interlocking")) return end + if not D.appropriate_signal(pos) then + minetest.chat_send_player(pname, attrans("Incompatible signal.")) + return + end distant_pos[pname] = pos minetest.chat_send_player(pname, attrans("Please punch the signal to use as the distant signal.")) end @@ -87,7 +95,7 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing) signal_pos[pname] = nil distant_pos[pname] = nil local is_signal = minetest.get_item_group(node.name, "advtrains_signal") >= 2 - if not is_signal then + if not (is_signal and D.appropriate_signal(pos)) then minetest.chat_send_player(pname, attrans("Incompatible signal.")) return end |