mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2025-01-08 01:00:25 +01: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