From 21d9cc420396d57d59603220aba193936342ac52 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Tue, 11 Aug 2015 11:42:23 +0200 Subject: [PATCH] Fix strange crash with tsm_pyramids - Solves #207 --- mods/tsm_pyramids/room.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/tsm_pyramids/room.lua b/mods/tsm_pyramids/room.lua index 3d15c94f..76d7f209 100755 --- a/mods/tsm_pyramids/room.lua +++ b/mods/tsm_pyramids/room.lua @@ -66,8 +66,13 @@ minetest.register_globalstep(function(dtime) pyramids.timer = pyramids.timer + dtime if pyramids.timer < pyramids.max_time then return end pyramids.timer = 0 - for _,k in ipairs(pyramids.saved_chests) do - pyramids.fill_chest(k) + -- It might happen that chests are not loaded + if pyramids.saved_chests then + for _,k in ipairs(pyramids.saved_chests) do + pyramids.fill_chest(k) + end + else + pyramids.saved_chests = loadchests() or {} end minetest.log("action","[tsm_pyramids] Chests reloaded") end)