Skip to content

Commit

Permalink
consistently use utility function to check for elevator
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Sep 16, 2021
1 parent 80ba872 commit 4149fa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion on_receive_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions update_formspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4149fa4

Please sign in to comment.