mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Mixed 2 conditions into 1.
This commit is contained in:
parent
a1d98c080f
commit
06435e0f4c
1 changed files with 11 additions and 12 deletions
|
@ -231,8 +231,8 @@ mcl_damage.register_on_death(function(obj, reason)
|
|||
end)
|
||||
|
||||
mcl_damage.register_on_damage(function(obj, damage, reason)
|
||||
if obj:get_hp() - damage > 0 then
|
||||
if reason.source and (reason.source:is_player() or obj:get_luaentity()) then
|
||||
if (obj:get_hp() - damage > 0) and reason.source and
|
||||
(reason.source:is_player() or obj:get_luaentity()) then
|
||||
-- To avoid timing issues we cancel the previous job before adding a new one.
|
||||
if mcl_death_messages.assist[obj] then
|
||||
mcl_death_messages.assist[obj].job:cancel()
|
||||
|
@ -244,5 +244,4 @@ mcl_damage.register_on_damage(function(obj, damage, reason)
|
|||
end)
|
||||
mcl_death_messages.assist[obj] = {name = mcl_util.get_object_name(reason.source), job = new_job}
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue