math.floor triggers error if it gets something nil
parent
896baf8e05
commit
b5e8068a99
|
@ -4,7 +4,10 @@
|
|||
|
||||
local function to_int(n)
|
||||
--- Disallow floating-point numbers
|
||||
return math.floor(tonumber(n))
|
||||
local k = tonumber(n)
|
||||
if k then
|
||||
return math.floor(k)
|
||||
end
|
||||
end
|
||||
|
||||
local function updatemeta(pos)
|
||||
|
|
Loading…
Reference in New Issue