Fix arrow yaw when shooting from dispenser

This commit is contained in:
Wuzzy 2017-02-14 22:28:40 +01:00
parent feca7cf694
commit 1bf5c51d37

View file

@ -84,9 +84,10 @@ local dispenserdef = {
--[===[ Dispense item ]===] --[===[ Dispense item ]===]
if iname == "mcl_throwing:arrow" then if iname == "mcl_throwing:arrow" then
-- Shoot arrow -- Shoot arrow
local shootpos = vector.add(droppos, dropdir) local f = {x=dropdir.x, y=0, z=dropdir.z}
-- FIXME: Bad yaw of arrow when shootin local shootpos = vector.add(droppos, f)
mcl_throwing.shoot_arrow(iname, shootpos, dropdir, 0, nil) local yaw = math.atan2(dropdir.z, dropdir.x) + math.pi/2
mcl_throwing.shoot_arrow(iname, shootpos, dropdir, yaw, nil)
stack:take_item() stack:take_item()
inv:set_stack("main", stack_id, stack) inv:set_stack("main", stack_id, stack)