From 5df353c299461a3ebda56f3fe38de5777678fba8 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 8 Oct 2015 05:56:04 -0400 Subject: [PATCH] stop crash if HUD is returned nil (server too slow to emerge player) --- waypoints.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/waypoints.lua b/waypoints.lua index 0996f52..a8e4762 100644 --- a/waypoints.lua +++ b/waypoints.lua @@ -16,6 +16,11 @@ local waypoints_temp = {} unified_inventory.register_page("waypoints", { get_formspec = function(player) local player_name = player:get_player_name() + + -- build a "fake" temp entry if the server took too long + -- during sign-on and returned an empty entry + if not waypoints_temp[player_name] then waypoints_temp[player_name] = {hud = 1} end + local waypoints = datastorage.get(player_name, "waypoints") local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" .. "image[0,0;1,1;ui_waypoints_icon.png]" ..