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)
mana.regen_timer = mana.regen_timer + dtime
if mana.regen_timer >= mana.settings.regen_timer then
for name, infotable in pairs(mana.playerlist) do
mana.add_up_to(name, infotable.regen)
local players = minetest.get_connected_players()
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
mana.regen_timer = 0
end