Replenish stamina on respawn

This commit is contained in:
ClobberXD 2018-12-31 04:39:25 +05:30 committed by rubenwardy
parent 8b41008bc1
commit 0a8f7233ee

View file

@ -111,10 +111,13 @@ minetest.register_on_joinplayer(function(player)
}) })
end end
players[player:get_player_name()] = info players[player:get_player_name()] = info
end) end)
minetest.register_on_respawnplayer(function(player)
players[player:get_player_name()].stamina = STAMINA_MAX
end)
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
players[player:get_player_name()] = nil players[player:get_player_name()] = nil
end) end)