From 8b766a1ba0615fd24943ef648306be17ab33d2e2 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 23 Jul 2019 11:47:59 +0100 Subject: [PATCH] do not update stamina if 'interact' priv not true --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 31901e7..8e8f8c3 100644 --- a/init.lua +++ b/init.lua @@ -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