summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-08-16 21:14:48 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-08-16 21:14:48 +0100
commit0750ffd6fbefd8d2c2ef6788b6194764ba824d62 (patch)
treee3b6596e76695dceffa319bc3850929e8e9a6635 /init.lua
parente0546a868b96686bb3b7aa195bb5c71150a9174b (diff)
switched back to get/set_look_yaw/pitch for older clients
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 1f986ef..23ba87b 100644
--- a/init.lua
+++ b/init.lua
@@ -252,16 +252,19 @@ function minetest.is_protected(pos, digger)
and player then
-- yaw + 180°
- local yaw = player:get_look_horizontal() + math.pi
+ --local yaw = player:get_look_horizontal() + math.pi
+ local yaw = player:get_look_yaw() + math.pi
if yaw > 2 * math.pi then
yaw = yaw - 2 * math.pi
end
- player:set_look_horizontal(yaw)
+ --player:set_look_horizontal(yaw)
+ player:set_look_yaw(yaw)
-- invert pitch
- player:set_look_vertical(-player:get_look_vertical())
+ --player:set_look_vertical(-player:get_look_vertical())
+ player:set_look_pitch(-player:get_look_pitch())
-- if digging below player, move up to avoid falling through hole
local pla_pos = player:getpos()