summaryrefslogtreecommitdiff
path: root/waypoints.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-10-08 05:56:04 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-10-08 05:56:04 -0400
commit5df353c299461a3ebda56f3fe38de5777678fba8 (patch)
tree6b599ba44bc727b36406a59b73f470b50127ce04 /waypoints.lua
parent9fe84789bad32f1e915d4a452347ce4021d87c2d (diff)
stop crash if HUD is returned nil (server too slow to emerge player)
Diffstat (limited to 'waypoints.lua')
-rw-r--r--waypoints.lua5
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]" ..