Replace get_look_yaw with get_look_horizontal

This commit is contained in:
Lars
2022-03-05 11:00:58 -08:00
parent 64c94310ef
commit fcaa079a84
3 changed files with 13 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ minetest.register_tool("rangedweapons:forcegun", {
local pos = user:get_pos()
local dir = user:get_look_dir()
local yaw = user:get_look_yaw()
local yaw = user:get_look_horizontal()
local inv = user:get_inventory()
if inv:contains_item("main", "rangedweapons:power_particle 40") then
if pos and dir then
@@ -18,7 +18,7 @@ if inv:contains_item("main", "rangedweapons:power_particle 40") then
minetest.sound_play("rangedweapons_rocket", {object=obj})
obj:set_velocity({x=dir.x * 60, y=dir.y * 60, z=dir.z * 60})
obj:setyaw(yaw + math.pi)
obj:setyaw(yaw - math.pi/2)
proj_dir = dir
local ent = obj:get_luaentity()
if ent then