mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-03-22 15:22:31 +01:00
change get_look_pitch to get_look_vertical
This commit is contained in:
6
tool.lua
6
tool.lua
@ -33,13 +33,13 @@ minetest.register_craftitem("protector:tool", {
|
|||||||
local dir = minetest.dir_to_facedir( user:get_look_dir() )
|
local dir = minetest.dir_to_facedir( user:get_look_dir() )
|
||||||
local vec = {x = 0, y = 0, z = 0}
|
local vec = {x = 0, y = 0, z = 0}
|
||||||
local gap = (r * 2) + 1
|
local gap = (r * 2) + 1
|
||||||
local pit = user:get_look_pitch()
|
local pit = user:get_look_vertical()
|
||||||
|
|
||||||
-- set placement coords
|
-- set placement coords
|
||||||
if pit > 1.2 then
|
if pit > 1.2 then
|
||||||
vec.y = gap -- up
|
vec.y = -gap -- up
|
||||||
elseif pit < -1.2 then
|
elseif pit < -1.2 then
|
||||||
vec.y = -gap -- down
|
vec.y = gap -- down
|
||||||
elseif dir == 0 then
|
elseif dir == 0 then
|
||||||
vec.z = gap -- north
|
vec.z = gap -- north
|
||||||
elseif dir == 1 then
|
elseif dir == 1 then
|
||||||
|
Reference in New Issue
Block a user