From 1abbd0b6030b9da5f0e5a4ea5805b43334e5132f Mon Sep 17 00:00:00 2001 From: kaadmy Date: Wed, 4 Nov 2015 15:47:28 -0800 Subject: [PATCH] should have fixed problem where maps stay open a little too long when pressing esc --- mods/nav/map.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/nav/map.lua b/mods/nav/map.lua index 9472c5e..1d6107e 100644 --- a/mods/nav/map.lua +++ b/mods/nav/map.lua @@ -10,7 +10,7 @@ default.ui.register_page("nav_nav", form_nav) local open_formspecs = {} local timer = 10 -local update_time = 0.1 +local update_time = 0.2 function nav.add_waypoint(pos, name, label, isinfo, type) nav.waypoints[name] = {pos = pos, label = label, isinfo = isinfo or false, type = type} @@ -50,6 +50,8 @@ end function nav.show_map(player) local name = player:get_player_name() + if not open_formspecs[name] then return end + local pos = player:getpos() local form = default.ui.get_page("nav_nav") @@ -115,9 +117,7 @@ local function step(dtime) players[name] = player - if open_formspecs[name] == true then - nav.show_map(player) - end + nav.show_map(player) end for wptname, wpt in pairs(nav.waypoints) do