mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
d83cabbab6
@ -1147,10 +1147,13 @@ end
|
|||||||
-- @param #string GroupName Group name.
|
-- @param #string GroupName Group name.
|
||||||
-- @return #table Group template table.
|
-- @return #table Group template table.
|
||||||
function DATABASE:GetGroupTemplate( GroupName )
|
function DATABASE:GetGroupTemplate( GroupName )
|
||||||
local GroupTemplate = self.Templates.Groups[GroupName].Template
|
local GroupTemplate=nil
|
||||||
|
if self.Templates.Groups[GroupName] then
|
||||||
|
GroupTemplate = self.Templates.Groups[GroupName].Template
|
||||||
GroupTemplate.SpawnCoalitionID = self.Templates.Groups[GroupName].CoalitionID
|
GroupTemplate.SpawnCoalitionID = self.Templates.Groups[GroupName].CoalitionID
|
||||||
GroupTemplate.SpawnCategoryID = self.Templates.Groups[GroupName].CategoryID
|
GroupTemplate.SpawnCategoryID = self.Templates.Groups[GroupName].CategoryID
|
||||||
GroupTemplate.SpawnCountryID = self.Templates.Groups[GroupName].CountryID
|
GroupTemplate.SpawnCountryID = self.Templates.Groups[GroupName].CountryID
|
||||||
|
end
|
||||||
return GroupTemplate
|
return GroupTemplate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -14366,11 +14366,15 @@ function AIRBOSS:_GetOnboardNumbers( group, playeronly )
|
|||||||
-- Debug text.
|
-- Debug text.
|
||||||
local text = string.format( "Onboard numbers of group %s:", groupname )
|
local text = string.format( "Onboard numbers of group %s:", groupname )
|
||||||
|
|
||||||
|
local template=group:GetTemplate()
|
||||||
|
|
||||||
|
local numbers = {}
|
||||||
|
if template then
|
||||||
|
|
||||||
-- Units of template group.
|
-- Units of template group.
|
||||||
local units = group:GetTemplate().units
|
local units = template.units
|
||||||
|
|
||||||
-- Get numbers.
|
-- Get numbers.
|
||||||
local numbers = {}
|
|
||||||
for _, unit in pairs( units ) do
|
for _, unit in pairs( units ) do
|
||||||
|
|
||||||
-- Onboard number and unit name.
|
-- Onboard number and unit name.
|
||||||
@ -14393,6 +14397,25 @@ function AIRBOSS:_GetOnboardNumbers( group, playeronly )
|
|||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T2( self.lid .. text )
|
self:T2( self.lid .. text )
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if playeronly then
|
||||||
|
return 101
|
||||||
|
else
|
||||||
|
|
||||||
|
local units=group:GetUnits()
|
||||||
|
|
||||||
|
for i,_unit in pairs(units) do
|
||||||
|
local name=_unit:GetName()
|
||||||
|
|
||||||
|
numbers[name]=100+i
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
return numbers
|
return numbers
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1778,10 +1778,14 @@ end
|
|||||||
|
|
||||||
--- Returns the group template from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
|
--- Returns the group template from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @return #table
|
-- @return #table Template table.
|
||||||
function GROUP:GetTemplate()
|
function GROUP:GetTemplate()
|
||||||
local GroupName = self:GetName()
|
local GroupName = self:GetName()
|
||||||
return UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ) )
|
local template=_DATABASE:GetGroupTemplate( GroupName )
|
||||||
|
if template then
|
||||||
|
return UTILS.DeepCopy( template )
|
||||||
|
end
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the group template route.points[] (the waypoints) from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
|
--- Returns the group template route.points[] (the waypoints) from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user