mirror of
https://notabug.org/TenPlus1/bonemeal.git
synced 2024-11-19 23:43:47 +01:00
add additional nil checks for servers with luajit issues
This commit is contained in:
parent
c621448df3
commit
f3ad4abff1
4
init.lua
4
init.lua
@ -265,14 +265,18 @@ local function check_soil(pos, nodename, strength)
|
||||
pos2.y = pos2.y + 1
|
||||
|
||||
if math.random(1, 5) == 5 then
|
||||
if decor and #decor > 0 then
|
||||
-- place random decoration (rare)
|
||||
local dnum = #decor or 1
|
||||
nod = decor[math.random(1, dnum)] or ""
|
||||
end
|
||||
else
|
||||
if grass and #grass > 0 then
|
||||
-- place random grass (common)
|
||||
local dgra = #grass or 1
|
||||
nod = #grass > 0 and grass[math.random(1, dgra)] or ""
|
||||
end
|
||||
end
|
||||
|
||||
if nod and nod ~= "" then
|
||||
def = minetest.registered_nodes[nod]
|
||||
|
Loading…
Reference in New Issue
Block a user