From 843f2d2a80b5f8dce74a4c22bba0f294ba19614f Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 20 Jul 2020 19:48:58 -0400 Subject: [PATCH] Correct issue where player/entities dies before effect is given --- mods/ITEMS/mcl_potions/functions.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 0df42b81..97906682 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -457,16 +457,20 @@ function mcl_potions.healing_func(player, hp) if obj and obj._cmi_is_mob then obj.health = math.max(obj.health + hp, obj.hp_max) - else + elseif player:is_player() player:set_hp(math.min(player:get_hp() + hp, player:get_properties().hp_max), { type = "set_hp", other = "healing" }) + else + return end else if obj and obj._cmi_is_mob then obj.health = obj.health + hp - else + elseif player:is_player() player:set_hp(player:get_hp() + hp, { type = "punch", other = "harming" }) + else + return end end