added nil fallback

This commit is contained in:
TenPlus1 2019-09-30 09:06:12 +01:00
parent 1299f39126
commit 5949d15726

View File

@ -266,7 +266,7 @@ local function check_soil(pos, nodename, strength)
if math.random(1, 5) == 5 then
-- place random decoration (rare)
nod = decor[math.random(1, #decor)] or ""
nod = decor[math.random(1, (#decor or 1))] or ""
else
-- place random grass (common)
nod = #grass > 0 and grass[math.random(1, #grass)] or ""