From aa75e722c39aa4e8b7cde3bb07c446b89caa661c Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 16 Feb 2017 05:46:44 +0100 Subject: [PATCH] add random content to default:chest as well --- fill_chest.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fill_chest.lua b/fill_chest.lua index fbb3f8c..9abcc67 100644 --- a/fill_chest.lua +++ b/fill_chest.lua @@ -6,6 +6,7 @@ mg_villages.random_chest_content = {}; -- add random chest content local ADD_RCC = function( data ) if( data and #data>3 and ( minetest.registered_nodes[ data[1] ] or minetest.registered_items[ data[1] ]) ) then + data.chest_default = 1; table.insert( mg_villages.random_chest_content, data ); end end @@ -158,7 +159,7 @@ mg_villages.fill_chest_random = function( pos, pr, building_nr, building_typ ) if( pos.typ_name ) then typ = pos.typ_name; end - if( not( typ ) or (typ ~= 'cottages:shelf' and typ ~= 'cottages:chest_work' and typ ~= 'cottages:chest_storage' and typ ~= 'cottages:chest_private' )) then + if( not( typ ) or (typ ~= 'cottages:shelf' and typ ~= 'cottages:chest_work' and typ ~= 'cottages:chest_storage' and typ ~= 'cottages:chest_private' and typ ~= 'cottages:chest_default')) then typ = building_data.typ; else typ = string.sub( typ, 10 );