Move os.time call out of loop

This commit is contained in:
raymoo 2016-01-13 16:56:06 -08:00
parent bcc0dfb47c
commit 9f76f6ef2a

View File

@ -297,8 +297,7 @@ local function add_hud(player, uid, disp_name, dur, icon)
end
local function update_hud(player)
local now = os.time()
local function update_hud(now, player)
local p_name = player:get_player_name()
local p_huds = huds[p_name]
@ -729,9 +728,11 @@ end
local function on_hud_timer()
local now = os.time()
for i, player in ipairs(minetest.get_connected_players()) do
update_hud(player)
update_hud(now, player)
end
end