mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
nil check
This commit is contained in:
parent
874fa7ad69
commit
ac42b56b8e
@ -702,8 +702,9 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE PointVec2Reference The reference @{#COORDINATE}.
|
-- @param #COORDINATE PointVec2Reference The reference @{#COORDINATE}.
|
||||||
-- @return DCS#Distance The distance from the reference @{#COORDINATE} in meters.
|
-- @return DCS#Distance The distance from the reference @{#COORDINATE} in meters.
|
||||||
function COORDINATE:DistanceFromPointVec2( PointVec2Reference )
|
function COORDINATE:DistanceFromPointVec2( PointVec2Reference )
|
||||||
self:F2( PointVec2Reference )
|
self:F2( PointVec2Reference )
|
||||||
|
if not PointVec2Reference then return math.huge end
|
||||||
|
|
||||||
local Distance = ( ( PointVec2Reference.x - self.x ) ^ 2 + ( PointVec2Reference.z - self.z ) ^2 ) ^ 0.5
|
local Distance = ( ( PointVec2Reference.x - self.x ) ^ 2 + ( PointVec2Reference.z - self.z ) ^2 ) ^ 0.5
|
||||||
|
|
||||||
self:T2( Distance )
|
self:T2( Distance )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user