From f19412556eedb2cbd450e34e5c7aed812cd92977 Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Thu, 14 Sep 2017 23:05:03 -0500 Subject: [PATCH] Fix get_decoration handling of tables. --- deco.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deco.lua b/deco.lua index 7ff7658..754b394 100644 --- a/deco.lua +++ b/deco.lua @@ -376,7 +376,11 @@ local function get_decoration(biome_name) if not deco.biomes or deco.biomes[biome_name] then if deco.deco_type == "simple" then if deco.fill_ratio and math.random(1000) - 1 < deco.fill_ratio * 1000 then - return deco.decoration + if type(deco.decoration) == 'string' then + return deco.decoration + elseif type(deco.decoration) == 'table' then + return deco.decoration[math.random(#deco.decoration)] + end end end end