mirror of
https://notabug.org/TenPlus1/bonemeal.git
synced 2024-12-05 03:33:45 +01:00
add additional nil checks for servers with luajit issues
This commit is contained in:
parent
c621448df3
commit
f3ad4abff1
16
init.lua
16
init.lua
@ -265,13 +265,17 @@ local function check_soil(pos, nodename, strength)
|
||||
pos2.y = pos2.y + 1
|
||||
|
||||
if math.random(1, 5) == 5 then
|
||||
-- place random decoration (rare)
|
||||
local dnum = #decor or 1
|
||||
nod = decor[math.random(1, dnum)] or ""
|
||||
if decor and #decor > 0 then
|
||||
-- place random decoration (rare)
|
||||
local dnum = #decor or 1
|
||||
nod = decor[math.random(1, dnum)] or ""
|
||||
end
|
||||
else
|
||||
-- place random grass (common)
|
||||
local dgra = #grass or 1
|
||||
nod = #grass > 0 and grass[math.random(1, dgra)] or ""
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user