From 4149fa4ece76dcb06e59d09ad87770fe34d80d88 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Thu, 16 Sep 2021 15:01:38 +1000 Subject: [PATCH] consistently use utility function to check for elevator --- on_receive_fields.lua | 2 +- update_formspec.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/on_receive_fields.lua b/on_receive_fields.lua index 2208972..4baefbf 100644 --- a/on_receive_fields.lua +++ b/on_receive_fields.lua @@ -153,7 +153,7 @@ function travelnet.on_receive_fields(pos, _, fields, player) minetest.chat_send_player(name, S("Initiating transfer to station '@1'.", fields.target or "?")) if travelnet.travelnet_sound_enabled then - if node.name == "travelnet:elevator" then + if travelnet.is_elevator(node.name) then minetest.sound_play("travelnet_bell", { pos = pos, gain = 0.75, diff --git a/update_formspec.lua b/update_formspec.lua index 63ef32e..51255ca 100644 --- a/update_formspec.lua +++ b/update_formspec.lua @@ -8,8 +8,8 @@ end function travelnet.update_formspec(pos, puncher_name, fields) local meta = minetest.get_meta(pos) - local this_node = minetest.get_node(pos) - local is_elevator = this_node ~= nil and this_node.name == "travelnet:elevator" + local node = minetest.get_node(pos) + local is_elevator = travelnet.is_elevator(node.name) if not meta then return