summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-02-23 01:39:48 +0100
committerWuzzy <almikes@aol.com>2015-02-23 01:39:48 +0100
commitcfe8b3a60b23aa48fddffc099be3abf6577c8b99 (patch)
tree42450aae62d8d425c46401ad1d609bafd6ecf0a8 /init.lua
parent25b59646c2254903b3d1ca9a1b26140f36315952 (diff)
Remove pointless delays and useless code
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua33
1 files changed, 13 insertions, 20 deletions
diff --git a/init.lua b/init.lua
index 526f221..f268921 100644
--- a/init.lua
+++ b/init.lua
@@ -314,11 +314,9 @@ local function update_hud(player)
end
minetest.register_on_joinplayer(function(player)
- minetest.after(0.5, function()
- hide_builtin(player)
- custom_hud(player)
- hb.players[player:get_player_name()] = player
- end)
+ hide_builtin(player)
+ custom_hud(player)
+ hb.players[player:get_player_name()] = player
end)
minetest.register_on_leaveplayer(function(player)
@@ -327,23 +325,18 @@ end)
local main_timer = 0
local timer = 0
-local timer2 = 0
-minetest.after(2.5, function()
- minetest.register_globalstep(function(dtime)
- main_timer = main_timer + dtime
- timer = timer + dtime
- timer2 = timer2 + dtime
- if main_timer > hb.settings.tick or timer > 4 then
- if main_timer > hb.settings.tick then main_timer = 0 end
- for playername, player in pairs(hb.players) do
+minetest.register_globalstep(function(dtime)
+ main_timer = main_timer + dtime
+ timer = timer + dtime
+ if main_timer > hb.settings.tick or timer > 4 then
+ if main_timer > hb.settings.tick then main_timer = 0 end
+ for playername, player in pairs(hb.players) do
-- only proceed if damage is enabled
if minetest.setting_getbool("enable_damage") then
- -- update all hud elements
- update_hud(player)
+ -- update all hud elements
+ update_hud(player)
end
- end
-
end
- if timer > 4 then timer = 0 end
- end)
+ end
+ if timer > 4 then timer = 0 end
end)