From 7731b6c892db2bd9227a3eaa11dd6ce29ef6d505 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 21 Oct 2022 15:15:32 +0200 Subject: [PATCH] fixes --- Moose Development/Moose/Utilities/Utils.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 756571f43..163d0f34a 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -1062,9 +1062,13 @@ end -- @return #number Distance between the vectors. function UTILS.VecDist2D(a, b) + local d = math.huge + + if (not a) or (not b) then return d end + local c={x=b.x-a.x, y=b.y-a.y} - local d=math.sqrt(c.x*c.x+c.y*c.y) + d=math.sqrt(c.x*c.x+c.y*c.y) return d end @@ -1076,6 +1080,7 @@ end -- @return #number Distance between the vectors. function UTILS.VecDist3D(a, b) + local d = math.huge if (not a) or (not b) then return d end