do not update stamina if 'interact' priv not true

This commit is contained in:
TenPlus1 2019-07-23 11:47:59 +01:00
parent 0f57240fd1
commit 8b766a1ba0

View File

@ -57,6 +57,11 @@ local function stamina_update_level(player, level)
return
end
-- players without interact priv cannot eat
if not minetest.check_player_privs(player, {interact = true}) then
return
end
player:set_attribute("stamina:level", level)
player:hud_change(stamina.players[player:get_player_name()].hud_id,
@ -271,7 +276,7 @@ local function stamina_globaltimer(dtime)
poison_timer = 0
end
end
end
-- sprint control and particle animation