updated to set/get_look_horizontal as well

This commit is contained in:
TenPlus1 2016-07-21 11:34:25 +01:00
parent 04166fc7e4
commit 3998db207c
1 changed files with 2 additions and 2 deletions

View File

@ -252,13 +252,13 @@ function minetest.is_protected(pos, digger)
and player then
-- yaw + 180°
local yaw = player:get_look_yaw() + math.pi
local yaw = player:get_look_horizontal() + math.pi
if yaw > 2 * math.pi then
yaw = yaw - 2 * math.pi
end
player:set_look_yaw(yaw)
player:set_look_horizontal(yaw)
-- invert pitch
player:set_look_vertical(-player:get_look_vertical())