From d0c0e4c78ac7fca57c53f9a8deaadd326e5aebd9 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 30 Jun 2020 20:26:09 +0100 Subject: [PATCH] bucket or glass of milk negates drunk and poison effects --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3b47583..0e2c013 100644 --- a/init.lua +++ b/init.lua @@ -225,7 +225,7 @@ local function stamina_globaltimer(dtime) -- play burp sound every 20 seconds when drunk local num = stamina.players[name].drunk -if math.floor(num/20) == num/20 then +if num and num > 0 and math.floor(num / 20) == num / 20 then minetest.sound_play("stamina_burp", {to_player = name, gain = 0.7}, true) end @@ -508,7 +508,8 @@ function stamina.eat(hp_change, replace_with_item, itemstack, user, pointed_thin }) -- if player drinks bucket of milk then stop poison and being drunk - if itemstack:get_name() == "mobs:bucket_milk" then + if itemstack:get_name() == "mobs:bucket_milk" + or itemstack:get_name() == "mobs:glass_milk" then stamina.players[name].poisoned = 0 stamina.players[name].drunk = 0