From 27ef97c347c37324f7dd4ecc93e5414a3b8ef0f2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 9 Jan 2017 04:19:24 +0100 Subject: [PATCH] Use get_look_horizontal in compass func --- mods/mcl_compass/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/mcl_compass/init.lua b/mods/mcl_compass/init.lua index 300e6e586d..39667a3403 100644 --- a/mods/mcl_compass/init.lua +++ b/mods/mcl_compass/init.lua @@ -17,10 +17,10 @@ minetest.register_globalstep(function(dtime) minetest.setting_get("static_spawnpoint") or {x=0,y=0,z=0} local pos = player:getpos() - local dir = player:get_look_yaw() + local dir = player:get_look_horizontal() local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z)) if angle_north < 0 then angle_north = angle_north + 360 end - local angle_dir = 90 - math.deg(dir) + local angle_dir = -math.deg(dir) local angle_relative = (angle_north - angle_dir + 180) % 360 local compass_image = math.floor((angle_relative/11.25) + 0.5)%32