mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
parent
b9e4aba33c
commit
ccc74b1b98
@ -653,11 +653,7 @@ else
|
|||||||
minetest.log("info", "[3d_armor] Fire Nodes disabled")
|
minetest.log("info", "[3d_armor] Fire Nodes disabled")
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
function armor_step()
|
||||||
armor.timer = armor.timer + dtime
|
|
||||||
if armor.timer < ARMOR_UPDATE_TIME then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for _,player in pairs(minetest.get_connected_players()) do
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
@ -688,8 +684,12 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
armor.timer = 0
|
minetest.after(ARMOR_UPDATE_TIME, armor_step)
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
-- Launch once started
|
||||||
|
minetest.after(0, armor_step)
|
||||||
|
|
||||||
|
|
||||||
-- kill player when command issued
|
-- kill player when command issued
|
||||||
minetest.register_chatcommand("kill", {
|
minetest.register_chatcommand("kill", {
|
||||||
|
@ -64,13 +64,12 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
end, player)
|
end, player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
function step()
|
||||||
time = time + dtime
|
|
||||||
if time > update_time then
|
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
wieldview:update_wielded_item(player)
|
wieldview:update_wielded_item(player)
|
||||||
end
|
end
|
||||||
time = 0
|
time = 0
|
||||||
end
|
minetest.after(update_time, step)
|
||||||
end)
|
end
|
||||||
|
minetest.after(0, step)
|
||||||
|
|
||||||
|
@ -88,26 +88,21 @@ minetest.register_on_leaveplayer(function(player)
|
|||||||
hbarmor.player_active[name] = false
|
hbarmor.player_active[name] = false
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local main_timer = 0
|
local function hbarmor_step()
|
||||||
local timer = 0
|
|
||||||
minetest.register_globalstep(function(dtime)
|
|
||||||
main_timer = main_timer + dtime
|
|
||||||
timer = timer + dtime
|
|
||||||
if main_timer > hbarmor.tick or timer > 4 then
|
|
||||||
if minetest.setting_getbool("enable_damage") then
|
if minetest.setting_getbool("enable_damage") then
|
||||||
if main_timer > hbarmor.tick then main_timer = 0 end
|
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if hbarmor.player_active[name] == true then
|
if hbarmor.player_active[name] == true then
|
||||||
local ret = hbarmor.get_armor(player)
|
local ret = hbarmor.get_armor(player)
|
||||||
if ret == false then
|
if ret == false then
|
||||||
minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in globalstep returned with false!")
|
minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in step returned with false!")
|
||||||
end
|
end
|
||||||
-- update all hud elements
|
-- update all hud elements
|
||||||
update_hud(player)
|
update_hud(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if timer > 4 then timer = 0 end
|
minetest.after(hbarmor.tick, hbarmor_step)
|
||||||
end)
|
end
|
||||||
|
minetest.after(0, hbarmor_step)
|
||||||
|
Loading…
Reference in New Issue
Block a user