mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'FF/Ops' into FF/OpsRat
This commit is contained in:
@@ -1150,7 +1150,7 @@ end
|
||||
-- @return #string Text
|
||||
function BASE:_Serialize(Arguments)
|
||||
local text = UTILS.PrintTableToLog({Arguments}, 0, true)
|
||||
text = string.gsub(text,"\n","")
|
||||
text = string.gsub(text,"(\n+)","")
|
||||
text = string.gsub(text,"%(%(","%(")
|
||||
text = string.gsub(text,"%)%)","%)")
|
||||
text = string.gsub(text,"(%s+)","")
|
||||
|
||||
@@ -702,8 +702,9 @@ do -- COORDINATE
|
||||
-- @param #COORDINATE PointVec2Reference The reference @{#COORDINATE}.
|
||||
-- @return DCS#Distance The distance from the reference @{#COORDINATE} in meters.
|
||||
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
|
||||
|
||||
self:T2( Distance )
|
||||
@@ -3147,17 +3148,18 @@ do -- COORDINATE
|
||||
-- @param #string Northing Meters northing - string in order to allow for leading zeros, e.g. "12340". Should be 5 digits.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:NewFromMGRS( UTMZone, MGRSDigraph, Easting, Northing )
|
||||
if string.len(Easting) < 5 then Easting = Easting..string.rep("0",5-string.len(Easting) )end
|
||||
if string.len(Northing) < 5 then Northing = Northing..string.rep("0",5-string.len(Northing) )end
|
||||
if string.len(Easting) < 5 then Easting = tostring(Easting..string.rep("0",5-string.len(Easting) )) end
|
||||
if string.len(Northing) < 5 then Northing = tostring(Northing..string.rep("0",5-string.len(Northing) )) end
|
||||
local MGRS = {
|
||||
UTMZone = UTMZone,
|
||||
MGRSDigraph = MGRSDigraph,
|
||||
Easting = Easting,
|
||||
Northing = Northing,
|
||||
Easting = tostring(Easting),
|
||||
Northing = tostring(Northing),
|
||||
}
|
||||
local lat, lon = coord.MGRStoLL(MGRS)
|
||||
local point = coord.LLtoLO(lat, lon, 0)
|
||||
local coord = COORDINATE:NewFromVec2({x=point.x,y=point.z})
|
||||
return coord
|
||||
end
|
||||
|
||||
--- Provides a coordinate string of the point, based on a coordinate format system:
|
||||
|
||||
@@ -3538,6 +3538,8 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
||||
if tonumber(SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN) ~= nil then
|
||||
local octal = SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN
|
||||
local num = UTILS.OctalToDecimal(octal)
|
||||
self.SpawnInitSADL = num -- we arrived here seeing that self.SpawnInitSADL == nil, but now that we have a SADL (num), we also need to set it to self.SpawnInitSADL in case
|
||||
-- we need to get the next SADL from _DATABASE, or else UTILS.OctalToDecimal() will fail in GetNextSADL
|
||||
if _DATABASE.SADL[num] ~= nil or UnitID > 1 then -- SADL taken or next unit
|
||||
octal = _DATABASE:GetNextSADL(self.SpawnInitSADL,SpawnTemplate.units[UnitID].name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user