fix: handle depreciations

This commit is contained in:
Kazhnuz 2021-07-28 10:14:12 +02:00
parent 85ffa8c735
commit 6302d80182

View file

@ -94,6 +94,8 @@ function Math.pointDirection(x1,y1,x2,y2)
local vecx, vecy, angle
vecy = y2 - y1
vecx = x2 - x1
-- We disable diagnostic to this line as we use LuaJIT 2.0
---@diagnostic disable-next-line: deprecated
angle = math.atan2(-vecy, vecx)
return angle
@ -140,11 +142,11 @@ function Math.numberToString(x, length)
local length = length or 1
local string = ""
local x = x
if (x >= math.pow(10, length)) then
if (x >= (10 ^ length)) then
string = string .. x
else
for i=1, (length-1) do
if (x < math.pow(10, length-i)) then
if (x < (10 ^ (length-i))) then
string = string .. "0"
end
end