Fix bug with regen

This commit is contained in:
Wuzzy 2015-02-14 06:04:13 +01:00
parent 1ed318446e
commit 3917a492f8

View File

@ -233,8 +233,12 @@ mana.regen_timer = 0
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
mana.regen_timer = mana.regen_timer + dtime mana.regen_timer = mana.regen_timer + dtime
if mana.regen_timer >= mana.settings.regen_timer then if mana.regen_timer >= mana.settings.regen_timer then
for name, infotable in pairs(mana.playerlist) do local players = minetest.get_connected_players()
mana.add_up_to(name, infotable.regen) for i=1, #players do
local name = players[i]:get_player_name()
if mana.playerlist[name] ~= nil then
mana.add_up_to(name, mana.playerlist[name].regen)
end
end end
mana.regen_timer = 0 mana.regen_timer = 0
end end