diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2015-10-08 05:56:04 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2015-10-08 05:56:04 -0400 |
commit | 5df353c299461a3ebda56f3fe38de5777678fba8 (patch) | |
tree | 6b599ba44bc727b36406a59b73f470b50127ce04 /waypoints.lua | |
parent | 9fe84789bad32f1e915d4a452347ce4021d87c2d (diff) |
stop crash if HUD is returned nil (server too slow to emerge player)
Diffstat (limited to 'waypoints.lua')
-rw-r--r-- | waypoints.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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]" .. |