mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-19 07:55:10 +00:00
Correct issue where player/entities dies before effect is given
This commit is contained in:
parent
43c4b355ce
commit
843f2d2a80
1 changed files with 6 additions and 2 deletions
|
@ -457,16 +457,20 @@ function mcl_potions.healing_func(player, hp)
|
||||||
|
|
||||||
if obj and obj._cmi_is_mob then
|
if obj and obj._cmi_is_mob then
|
||||||
obj.health = math.max(obj.health + hp, obj.hp_max)
|
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" })
|
player:set_hp(math.min(player:get_hp() + hp, player:get_properties().hp_max), { type = "set_hp", other = "healing" })
|
||||||
|
else
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if obj and obj._cmi_is_mob then
|
if obj and obj._cmi_is_mob then
|
||||||
obj.health = obj.health + hp
|
obj.health = obj.health + hp
|
||||||
else
|
elseif player:is_player()
|
||||||
player:set_hp(player:get_hp() + hp, { type = "punch", other = "harming" })
|
player:set_hp(player:get_hp() + hp, { type = "punch", other = "harming" })
|
||||||
|
else
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue