From 7c3bf9715abda015d430cd1097327f6a9f6fc8a9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 15 Feb 2017 00:16:47 +0100 Subject: [PATCH] Fix direction issues of dispenser --- mods/redstone/mcl_dispensers/init.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mods/redstone/mcl_dispensers/init.lua b/mods/redstone/mcl_dispensers/init.lua index 4fc2e5de..90c99ea2 100644 --- a/mods/redstone/mcl_dispensers/init.lua +++ b/mods/redstone/mcl_dispensers/init.lua @@ -52,7 +52,7 @@ local dispenserdef = { local droppos, dropdir if node.name == "mcl_dispensers:dispenser" then dropdir = vector.multiply(minetest.facedir_to_dir(node.param2), -1) - droppos = vector.subtract(pos, dropdir) + droppos = vector.add(pos, dropdir) elseif node.name == "mcl_dispensers:dispenser_up" then dropdir = {x=0, y=1, z=0} droppos = {x=pos.x, y=pos.y+1, z=pos.z} @@ -84,8 +84,7 @@ local dispenserdef = { --[===[ Dispense item ]===] if iname == "mcl_throwing:arrow" then -- Shoot arrow - local f = {x=dropdir.x, y=0, z=dropdir.z} - local shootpos = vector.add(droppos, f) + local shootpos = vector.add(droppos, vector.multiply(dropdir, -1)) local yaw = math.atan2(dropdir.z, dropdir.x) + math.pi/2 mcl_throwing.shoot_arrow(iname, shootpos, dropdir, yaw, nil) @@ -94,8 +93,7 @@ local dispenserdef = { elseif iname == "mcl_throwing:egg" or iname == "mcl_throwing:snowball" then -- Throw egg or snowball - local f = {x=dropdir.x, y=0, z=dropdir.z} - local shootpos = vector.add(droppos, f) + local shootpos = vector.add(droppos, vector.multiply(dropdir, -1)) mcl_throwing.throw(iname, shootpos, dropdir) stack:take_item()