forked from MineClone5/MineClone5
Don't re-damage object with arrow if already dead
This commit is contained in:
parent
049c632276
commit
636ff60c68
|
@ -184,6 +184,7 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
|||
local is_player = obj:is_player()
|
||||
local lua = obj:get_luaentity()
|
||||
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, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=self._damage},
|
||||
|
@ -207,6 +208,7 @@ ARROW_ENTITY.on_step = function(self, dtime)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue