mirror of
https://github.com/minetest-mods/digtron.git
synced 2025-01-03 17:37:28 +01:00
fix crash when entering non-numeric period or offset in builder config
This commit is contained in:
parent
dfeb4546fe
commit
1307710a60
@ -78,9 +78,13 @@ minetest.register_node("digtron:builder", {
|
|||||||
local offset = tonumber(fields.offset)
|
local offset = tonumber(fields.offset)
|
||||||
if period and period > 0 then
|
if period and period > 0 then
|
||||||
meta:set_int("period", math.floor(tonumber(fields.period)))
|
meta:set_int("period", math.floor(tonumber(fields.period)))
|
||||||
|
else
|
||||||
|
period = meta:get_int("period")
|
||||||
end
|
end
|
||||||
if offset then
|
if offset then
|
||||||
meta:set_int("offset", math.floor(tonumber(fields.offset)))
|
meta:set_int("offset", math.floor(tonumber(fields.offset)))
|
||||||
|
else
|
||||||
|
offset = meta:get_int("offset")
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.set then
|
if fields.set then
|
||||||
|
Loading…
Reference in New Issue
Block a user