mirror of
https://notabug.org/TenPlus1/bonemeal.git
synced 2024-08-20 21:44:09 +02:00
added nil fallback
This commit is contained in:
parent
1299f39126
commit
5949d15726
2
init.lua
2
init.lua
@ -266,7 +266,7 @@ 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 ""
|
nod = decor[math.random(1, (#decor or 1))] or ""
|
||||||
else
|
else
|
||||||
-- place random grass (common)
|
-- place random grass (common)
|
||||||
nod = #grass > 0 and grass[math.random(1, #grass)] or ""
|
nod = #grass > 0 and grass[math.random(1, #grass)] or ""
|
||||||
|
Loading…
Reference in New Issue
Block a user