1
0
Fork 0

Don't re-damage object with arrow if already dead

objects
Wuzzy 2019-03-08 22:31:26 +01:00
parent 049c632276
commit 636ff60c68
1 changed files with 19 additions and 17 deletions

View File

@ -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