summaryrefslogtreecommitdiff
path: root/digilines_rtc/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'digilines_rtc/init.lua')
-rw-r--r--digilines_rtc/init.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/digilines_rtc/init.lua b/digilines_rtc/init.lua
index b2b21ec..6b7bfaf 100644
--- a/digilines_rtc/init.lua
+++ b/digilines_rtc/init.lua
@@ -17,9 +17,9 @@ local rtc_selbox =
}
local on_digiline_receive = function (pos, node, channel, msg)
- local setchan = minetest.env:get_meta(pos):get_string("channel")
+ local setchan = minetest.get_meta(pos):get_string("channel")
if channel == setchan and msg == GET_COMMAND then
- local timeofday = minetest.env:get_timeofday()
+ local timeofday = minetest.get_timeofday()
digiline:receptor_send(pos, digiline.rules.default, channel, timeofday)
end
end
@@ -42,12 +42,12 @@ minetest.register_node("digilines_rtc:rtc", {
},
},
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos)
- fields.channel = fields.channel or ""
- meta:set_string("channel", fields.channel)
+ if (fields.channel) then
+ minetest.get_meta(pos):set_string("channel", fields.channel)
+ end
end,
})