mirror of
https://github.com/minetest-mods/hbsprint.git
synced 2024-12-22 13:22:24 +01:00
Don't replenish stamina when jumping.
This commit is contained in:
parent
5be91db7bc
commit
7dd27f01dd
3
init.lua
3
init.lua
@ -90,7 +90,8 @@ end
|
|||||||
|
|
||||||
local function replenish_stamina(player)
|
local function replenish_stamina(player)
|
||||||
local player_stamina = player:get_meta():get_float("hbsprint:stamina")
|
local player_stamina = player:get_meta():get_float("hbsprint:stamina")
|
||||||
if player_stamina < 20 then
|
local ctrl = player:get_player_control()
|
||||||
|
if player_stamina < 20 and not ctrl.jump then
|
||||||
player_stamina = math.min(20, player_stamina + stamina_heal)
|
player_stamina = math.min(20, player_stamina + stamina_heal)
|
||||||
player:get_meta():set_float("hbsprint:stamina", player_stamina)
|
player:get_meta():set_float("hbsprint:stamina", player_stamina)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user