From 088bdc53504f1c56593d677fbfc84707ea335f5e Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 21 Oct 2022 12:14:11 +0100 Subject: [PATCH] localise math.deg --- api.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 08524bb..cb6ab08 100644 --- a/api.lua +++ b/api.lua @@ -44,6 +44,7 @@ local random = math.random local floor = math.floor local ceil = math.ceil local rad = math.rad +local deg = math.deg local atann = math.atan local atan = function(x) if not x or x ~= x then @@ -360,11 +361,11 @@ function mob_class:set_yaw(yaw, delay) end -- clamp our yaw to a 360 range - if math.deg(self.object:get_yaw()) > 360 then + if deg(self.object:get_yaw()) > 360 then yaw = rad(10) ; delay = 0 - elseif math.deg(self.object:get_yaw()) < 0 then + elseif deg(self.object:get_yaw()) < 0 then yaw = rad(350) ; delay = 0 end