fix: handle depreciations
This commit is contained in:
parent
85ffa8c735
commit
6302d80182
1 changed files with 4 additions and 2 deletions
|
@ -94,6 +94,8 @@ function Math.pointDirection(x1,y1,x2,y2)
|
||||||
local vecx, vecy, angle
|
local vecx, vecy, angle
|
||||||
vecy = y2 - y1
|
vecy = y2 - y1
|
||||||
vecx = x2 - x1
|
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)
|
angle = math.atan2(-vecy, vecx)
|
||||||
|
|
||||||
return angle
|
return angle
|
||||||
|
@ -140,11 +142,11 @@ function Math.numberToString(x, length)
|
||||||
local length = length or 1
|
local length = length or 1
|
||||||
local string = ""
|
local string = ""
|
||||||
local x = x
|
local x = x
|
||||||
if (x >= math.pow(10, length)) then
|
if (x >= (10 ^ length)) then
|
||||||
string = string .. x
|
string = string .. x
|
||||||
else
|
else
|
||||||
for i=1, (length-1) do
|
for i=1, (length-1) do
|
||||||
if (x < math.pow(10, length-i)) then
|
if (x < (10 ^ (length-i))) then
|
||||||
string = string .. "0"
|
string = string .. "0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue