mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-01-09 17:50:25 +01:00
Use get_look_horizontal instead of deprecated get_look_yaw
This commit is contained in:
parent
5a38a386eb
commit
af35502e61
2
init.lua
2
init.lua
@ -16,7 +16,7 @@ local function shoot_arrow(itemstack, player)
|
||||
local dir = player:get_look_dir()
|
||||
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
|
||||
obj:setacceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
|
||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
||||
obj:setyaw(player:get_look_horizontal()-math.pi/2)
|
||||
minetest.sound_play("throwing_sound", {pos=playerpos, gain = 0.5})
|
||||
obj:get_luaentity().player = player:get_player_name()
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user