mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/Apple/Develop' into develop
# Conflicts: # Moose Development/Moose/Core/Database.lua # Moose Development/Moose/Core/Set.lua # Moose Development/Moose/Utilities/Profiler.lua
This commit is contained in:
commit
a437da76ec
@ -1539,32 +1539,32 @@ function DATABASE:_RegisterTemplates()
|
||||
|
||||
self.Navpoints = {}
|
||||
self.UNITS = {}
|
||||
--Build routines.db.units and self.Navpoints
|
||||
for CoalitionName, coa_data in pairs(env.mission.coalition) do
|
||||
self:T({CoalitionName=CoalitionName})
|
||||
-- Build routines.db.units and self.Navpoints
|
||||
for CoalitionName, coa_data in pairs( env.mission.coalition ) do
|
||||
self:T( { CoalitionName = CoalitionName } )
|
||||
|
||||
if (CoalitionName == 'red' or CoalitionName == 'blue' or CoalitionName == 'neutrals') and type(coa_data) == 'table' then
|
||||
--self.Units[coa_name] = {}
|
||||
if (CoalitionName == 'red' or CoalitionName == 'blue' or CoalitionName == 'neutrals') and type( coa_data ) == 'table' then
|
||||
-- self.Units[coa_name] = {}
|
||||
|
||||
local CoalitionSide = coalition.side[string.upper(CoalitionName)]
|
||||
if CoalitionName=="red" then
|
||||
CoalitionSide=coalition.side.RED
|
||||
elseif CoalitionName=="blue" then
|
||||
CoalitionSide=coalition.side.BLUE
|
||||
local CoalitionSide = coalition.side[string.upper( CoalitionName )]
|
||||
if CoalitionName == "red" then
|
||||
CoalitionSide = coalition.side.RED
|
||||
elseif CoalitionName == "blue" then
|
||||
CoalitionSide = coalition.side.BLUE
|
||||
else
|
||||
CoalitionSide=coalition.side.NEUTRAL
|
||||
CoalitionSide = coalition.side.NEUTRAL
|
||||
end
|
||||
|
||||
-- build nav points DB
|
||||
self.Navpoints[CoalitionName] = {}
|
||||
if coa_data.nav_points then --navpoints
|
||||
for nav_ind, nav_data in pairs(coa_data.nav_points) do
|
||||
if coa_data.nav_points then -- navpoints
|
||||
for nav_ind, nav_data in pairs( coa_data.nav_points ) do
|
||||
|
||||
if type(nav_data) == 'table' then
|
||||
self.Navpoints[CoalitionName][nav_ind] = routines.utils.deepCopy(nav_data)
|
||||
if type( nav_data ) == 'table' then
|
||||
self.Navpoints[CoalitionName][nav_ind] = routines.utils.deepCopy( nav_data )
|
||||
|
||||
self.Navpoints[CoalitionName][nav_ind]['name'] = nav_data.callsignStr -- name is a little bit more self-explanatory.
|
||||
self.Navpoints[CoalitionName][nav_ind]['point'] = {} -- point is used by SSE, support it.
|
||||
self.Navpoints[CoalitionName][nav_ind]['name'] = nav_data.callsignStr -- name is a little bit more self-explanatory.
|
||||
self.Navpoints[CoalitionName][nav_ind]['point'] = {} -- point is used by SSE, support it.
|
||||
self.Navpoints[CoalitionName][nav_ind]['point']['x'] = nav_data.x
|
||||
self.Navpoints[CoalitionName][nav_ind]['point']['y'] = 0
|
||||
self.Navpoints[CoalitionName][nav_ind]['point']['z'] = nav_data.y
|
||||
@ -1573,26 +1573,36 @@ function DATABASE:_RegisterTemplates()
|
||||
end
|
||||
|
||||
-------------------------------------------------
|
||||
if coa_data.country then --there is a country table
|
||||
for cntry_id, cntry_data in pairs(coa_data.country) do
|
||||
if coa_data.country then -- there is a country table
|
||||
for cntry_id, cntry_data in pairs( coa_data.country ) do
|
||||
|
||||
local CountryName = string.upper(cntry_data.name)
|
||||
local CountryName = string.upper( cntry_data.name )
|
||||
local CountryID = cntry_data.id
|
||||
|
||||
self.COUNTRY_ID[CountryName] = CountryID
|
||||
self.COUNTRY_NAME[CountryID] = CountryName
|
||||
|
||||
--self.Units[coa_name][countryName] = {}
|
||||
--self.Units[coa_name][countryName]["countryId"] = cntry_data.id
|
||||
-- self.Units[coa_name][countryName] = {}
|
||||
-- self.Units[coa_name][countryName]["countryId"] = cntry_data.id
|
||||
|
||||
if type(cntry_data) == 'table' then --just making sure
|
||||
if type( cntry_data ) == 'table' then -- just making sure
|
||||
|
||||
for obj_type_name, obj_type_data in pairs(cntry_data) do
|
||||
for obj_type_name, obj_type_data in pairs( cntry_data ) do
|
||||
|
||||
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then --should be an unncessary check
|
||||
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then -- should be an unncessary check
|
||||
|
||||
local CategoryName = obj_type_name
|
||||
|
||||
if ((type( obj_type_data ) == 'table') and obj_type_data.group and (type( obj_type_data.group ) == 'table') and (#obj_type_data.group > 0)) then -- there's a group!
|
||||
|
||||
-- self.Units[coa_name][countryName][category] = {}
|
||||
|
||||
for group_num, Template in pairs( obj_type_data.group ) do
|
||||
|
||||
if obj_type_name ~= "static" and Template and Template.units and type( Template.units ) == 'table' then -- making sure again- this is a valid group
|
||||
|
||||
self:_RegisterGroupTemplate( Template, CoalitionSide, _DATABASECategory[string.lower( CategoryName )], CountryID )
|
||||
|
||||
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
|
||||
|
||||
--self.Units[coa_name][countryName][category] = {}
|
||||
|
||||
@ -281,6 +281,8 @@ end
|
||||
-- @return #string Source file name.
|
||||
-- @return #string Line number.
|
||||
-- @return #number Function time in seconds.
|
||||
function PROFILER.getData( func )
|
||||
|
||||
function PROFILER.getData(func)
|
||||
|
||||
local n=PROFILER.dInfo[func]
|
||||
|
||||
@ -2468,4 +2468,3 @@ function UTILS.ToStringBRAANATO(FromGrp,ToGrp)
|
||||
end
|
||||
end
|
||||
return BRAANATO
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user