forked from mtcontrib/minetest_mana
Fix bug with regen
This commit is contained in:
parent
1ed318446e
commit
3917a492f8
8
init.lua
8
init.lua
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user