forked from LizzyFleckenstein03/Memeclone
Fix arrows from bow facing the wrong direction
This commit is contained in:
parent
e396ab8e4d
commit
d4ea161f33
|
@ -85,7 +85,7 @@ local dispenserdef = {
|
||||||
if iname == "mcl_throwing:arrow" then
|
if iname == "mcl_throwing:arrow" then
|
||||||
-- Shoot arrow
|
-- Shoot arrow
|
||||||
local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51))
|
local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51))
|
||||||
local yaw = math.atan2(dropdir.z, dropdir.x) + math.pi/2
|
local yaw = math.atan2(dropdir.z, dropdir.x) - math.pi/2
|
||||||
mcl_throwing.shoot_arrow(iname, shootpos, dropdir, yaw, nil)
|
mcl_throwing.shoot_arrow(iname, shootpos, dropdir, yaw, nil)
|
||||||
|
|
||||||
stack:take_item()
|
stack:take_item()
|
||||||
|
|
|
@ -13,7 +13,7 @@ mcl_throwing.shoot_arrow = function(arrow_item, pos, dir, yaw, shooter)
|
||||||
local obj = minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, arrows[arrow_item])
|
local obj = minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, arrows[arrow_item])
|
||||||
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
|
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
|
||||||
obj:setacceleration({x=dir.x*-3, y=-GRAVITY, z=dir.z*-3})
|
obj:setacceleration({x=dir.x*-3, y=-GRAVITY, z=dir.z*-3})
|
||||||
obj:setyaw(yaw+math.pi/2)
|
obj:setyaw(yaw-math.pi/2)
|
||||||
minetest.sound_play("mcl_throwing_bow_shoot", {pos=pos})
|
minetest.sound_play("mcl_throwing_bow_shoot", {pos=pos})
|
||||||
if shooter ~= nil then
|
if shooter ~= nil then
|
||||||
if obj:get_luaentity().player == "" then
|
if obj:get_luaentity().player == "" then
|
||||||
|
|
Loading…
Reference in New Issue