Spear drops when hits the target
This commit is contained in:
parent
8b567f927e
commit
dfcc66bb57
@ -31,7 +31,7 @@ function icicles.make_stalactite(pos, length)
|
||||
end
|
||||
|
||||
function icicles.make_stalagmite(pos, length)
|
||||
for i = length,1,-1 do
|
||||
for i = 1,length do
|
||||
if minetest.env:get_node({x=pos.x,y=pos.y+i-1,z=pos.z}).name == "air" then
|
||||
minetest.env:set_node({x=pos.x,y=pos.y+i-1,z=pos.z}, {name = "icicles:icicle_"..5-i})
|
||||
else return end
|
||||
|
@ -74,7 +74,7 @@ instruments.list = {"pick", "axe", "shovel", "hammer", "sword", "spear", "chisel
|
||||
instruments.spear.entity = {
|
||||
physical = false,
|
||||
timer=0,
|
||||
textures = {"spear_back.png"},
|
||||
textures = {"instruments_spear_back.png"},
|
||||
lastpos={},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
material = "stone",
|
||||
@ -93,7 +93,8 @@ instruments.spear.entity.on_step = function(self, dtime)
|
||||
if obj:get_hp()<=0 then
|
||||
obj:remove()
|
||||
end
|
||||
self.object:remove()
|
||||
minetest.env:add_item(self.lastpos, 'instruments:spear_'..self.object:get_luaentity().material)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
Loading…
x
Reference in New Issue
Block a user