Fix crash in mcl_hunger
This commit is contained in:
parent
f373f3a4f1
commit
793357cdfe
|
@ -116,7 +116,7 @@ local function poisonp(tick, time, time_left, damage, exhaustion, name)
|
||||||
-- TODO: Introduce fatal poison at higher difficulties
|
-- TODO: Introduce fatal poison at higher difficulties
|
||||||
if player:get_hp()-damage > 0 then
|
if player:get_hp()-damage > 0 then
|
||||||
if mod_death_messages then
|
if mod_death_messages then
|
||||||
mcl_death_messages.player_damage(player, S("@1 succumbed to the poison."), name)
|
mcl_death_messages.player_damage(player, S("@1 succumbed to the poison.", name))
|
||||||
end
|
end
|
||||||
player:set_hp(player:get_hp()-damage)
|
player:set_hp(player:get_hp()-damage)
|
||||||
end
|
end
|
||||||
|
|
|
@ -170,7 +170,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- TODO: Allow starvation at higher difficulty levels
|
-- TODO: Allow starvation at higher difficulty levels
|
||||||
if hp-1 > 0 then
|
if hp-1 > 0 then
|
||||||
if mod_death_messages then
|
if mod_death_messages then
|
||||||
mcl_death_messages.player_damage(player, S("@1 starved to death."), name)
|
mcl_death_messages.player_damage(player, S("@1 starved to death.", name))
|
||||||
end
|
end
|
||||||
player:set_hp(hp-1)
|
player:set_hp(hp-1)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user