mirror of
https://notabug.org/TenPlus1/bonemeal.git
synced 2024-08-21 14:14:11 +02:00
nil checks for grass and decoration lists
This commit is contained in:
parent
5949d15726
commit
c621448df3
6
init.lua
6
init.lua
@ -266,10 +266,12 @@ local function check_soil(pos, nodename, strength)
|
|||||||
|
|
||||||
if math.random(1, 5) == 5 then
|
if math.random(1, 5) == 5 then
|
||||||
-- place random decoration (rare)
|
-- place random decoration (rare)
|
||||||
nod = decor[math.random(1, (#decor or 1))] or ""
|
local dnum = #decor or 1
|
||||||
|
nod = decor[math.random(1, dnum)] or ""
|
||||||
else
|
else
|
||||||
-- place random grass (common)
|
-- place random grass (common)
|
||||||
nod = #grass > 0 and grass[math.random(1, #grass)] or ""
|
local dgra = #grass or 1
|
||||||
|
nod = #grass > 0 and grass[math.random(1, dgra)] or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
if nod and nod ~= "" then
|
if nod and nod ~= "" then
|
||||||
|
Loading…
Reference in New Issue
Block a user