Reset sprint on new match (#893)

This commit is contained in:
David Leal 2021-06-06 08:28:03 -05:00 committed by GitHub
parent 038dd3c1e5
commit 1831da8496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -35,6 +35,13 @@ local function setSprinting(player, info, sprinting)
end
end
ctf_match.register_on_new_match(function()
for pname in pairs(players) do
local player = minetest.get_player_by_name(pname)
players[player:get_player_name()].stamina = STAMINA_MAX
end
end)
minetest.register_globalstep(function(dtime)
for name, info in pairs(players) do
local player = minetest.get_player_by_name(name)

View file

@ -1,3 +1,3 @@
name = sprint
depends = medkits, physics
depends = medkits, physics, ctf_match
optional_depends = hudbars