From bdc555c290b474885c572a885dfe4c6c47f40518 Mon Sep 17 00:00:00 2001 From: Andrea Plati Date: Mon, 9 Mar 2015 22:31:30 +0100 Subject: [PATCH] Torch arrows are almost good --- torch_arrow.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/torch_arrow.lua b/torch_arrow.lua index 6a12140..70f9d41 100644 --- a/torch_arrow.lua +++ b/torch_arrow.lua @@ -46,7 +46,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) local node = minetest.get_node(pos) if self.timer>0.2 then - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1) + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 0.5) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "throwing:arrow_torch_entity" and obj:get_luaentity().name ~= "__builtin:item" then @@ -64,7 +64,9 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if self.lastpos.x~=nil then if node.name ~= "air" then self.object:remove() - minetest.place_node(self.lastpos, {name="default:torch"}) + local dir={x=pos.x-self.lastpos.x, y=pos.y-self.lastpos.y, z=pos.z-self.lastpos.z} + local wall=minetest.dir_to_wallmounted(dir) + minetest.add_node(self.lastpos, {name="default:torch", param2 = wall}) end end self.lastpos={x=pos.x, y=pos.y, z=pos.z}