From 1bf5c51d3799ab998e0f42246225e769f5f51f73 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 14 Feb 2017 22:28:40 +0100 Subject: [PATCH] Fix arrow yaw when shooting from dispenser --- mods/redstone/mcl_dispensers/init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/redstone/mcl_dispensers/init.lua b/mods/redstone/mcl_dispensers/init.lua index 49644f602d..d0cddf03c5 100644 --- a/mods/redstone/mcl_dispensers/init.lua +++ b/mods/redstone/mcl_dispensers/init.lua @@ -84,9 +84,10 @@ local dispenserdef = { --[===[ Dispense item ]===] if iname == "mcl_throwing:arrow" then -- Shoot arrow - local shootpos = vector.add(droppos, dropdir) - -- FIXME: Bad yaw of arrow when shootin - mcl_throwing.shoot_arrow(iname, shootpos, dropdir, 0, nil) + local f = {x=dropdir.x, y=0, z=dropdir.z} + local shootpos = vector.add(droppos, f) + local yaw = math.atan2(dropdir.z, dropdir.x) + math.pi/2 + mcl_throwing.shoot_arrow(iname, shootpos, dropdir, yaw, nil) stack:take_item() inv:set_stack("main", stack_id, stack)