drop arrow on remove
This commit is contained in:
parent
819daa52f1
commit
5013537e24
@ -12,11 +12,11 @@ bows.on_hit_object=function(self,target,hp,user,lastpos)
|
||||
self.object:set_attach(target, "", {x=(opos.x-pos.x)*4,y=(pos.y-opos.y)*4,z=(pos.z-opos.z)*4},{x=0,y=-90,z=0})
|
||||
else
|
||||
bows.arrow_remove(self)
|
||||
minetest.add_item(self.object:getpos(), self)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
bows.on_hit_node=function(self,pos,user,lastpos)
|
||||
if not minetest.registered_nodes[minetest.get_node(pos).name].node_box then
|
||||
local mpos={x=(pos.x-lastpos.x),y=(pos.y-lastpos.y),z=(pos.z-lastpos.z)}
|
||||
@ -84,6 +84,7 @@ minetest.register_entity("bows:arrow",{
|
||||
bows.tmp=nil
|
||||
self.object:set_properties({textures={self.arrow}})
|
||||
else
|
||||
minetest.add_item(self.object:getpos(), self.arrow)
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
@ -98,6 +99,7 @@ minetest.register_entity("bows:arrow",{
|
||||
if self.stuck then
|
||||
if self.target and self.target:get_hp()<=1 then self.timer=-1 end
|
||||
if self.timer<0 then
|
||||
minetest.add_item(self.object:getpos(), self.arrow)
|
||||
bows.arrow_remove(self)
|
||||
end
|
||||
return self
|
||||
|
Loading…
x
Reference in New Issue
Block a user