mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 08:59:32 +01:00
Don't re-damage object with arrow if already dead
This commit is contained in:
parent
049c632276
commit
636ff60c68
1 changed files with 19 additions and 17 deletions
|
@ -184,6 +184,7 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
local is_player = obj:is_player()
|
local is_player = obj:is_player()
|
||||||
local lua = obj:get_luaentity()
|
local lua = obj:get_luaentity()
|
||||||
if obj ~= self._shooter and (is_player or (lua and lua._cmi_is_mob)) then
|
if obj ~= self._shooter and (is_player or (lua and lua._cmi_is_mob)) then
|
||||||
|
if obj:get_hp() > 0 then
|
||||||
obj:punch(self.object, 1.0, {
|
obj:punch(self.object, 1.0, {
|
||||||
full_punch_interval=1.0,
|
full_punch_interval=1.0,
|
||||||
damage_groups={fleshy=self._damage},
|
damage_groups={fleshy=self._damage},
|
||||||
|
@ -207,6 +208,7 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue