summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-05 19:40:41 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-05 19:40:41 -0700
commit1307710a60589555f7f08da90b28b78ae111f565 (patch)
treebad32a1e49453bd8320dc9dd287ab5481e16a3ec
parentdfeb4546fec987c77e73a381f3c7d1e75c01a386 (diff)
fix crash when entering non-numeric period or offset in builder config
-rw-r--r--node_builders.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/node_builders.lua b/node_builders.lua
index c987e7f..394b627 100644
--- a/node_builders.lua
+++ b/node_builders.lua
@@ -78,9 +78,13 @@ minetest.register_node("digtron:builder", {
local offset = tonumber(fields.offset)
if period and period > 0 then
meta:set_int("period", math.floor(tonumber(fields.period)))
+ else
+ period = meta:get_int("period")
end
if offset then
meta:set_int("offset", math.floor(tonumber(fields.offset)))
+ else
+ offset = meta:get_int("offset")
end
if fields.set then