mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-11 11:48:38 +00:00
misc
This commit is contained in:
@@ -549,8 +549,9 @@ end
|
||||
-- This method is used by the SPAWN class.
|
||||
-- @param #DATABASE self
|
||||
-- @param #table SpawnTemplate Template of the group to spawn.
|
||||
-- @param #string Groupname (Optional) Name of the group.
|
||||
-- @return Wrapper.Group#GROUP Spawned group.
|
||||
function DATABASE:Spawn( SpawnTemplate )
|
||||
function DATABASE:Spawn( SpawnTemplate, Groupname )
|
||||
self:F( SpawnTemplate.name )
|
||||
|
||||
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
|
||||
@@ -565,7 +566,7 @@ function DATABASE:Spawn( SpawnTemplate )
|
||||
SpawnTemplate.CountryID = nil
|
||||
SpawnTemplate.CategoryID = nil
|
||||
|
||||
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID )
|
||||
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID, Groupname )
|
||||
|
||||
self:T3( SpawnTemplate )
|
||||
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
|
||||
|
||||
@@ -1251,17 +1251,19 @@ do -- COORDINATE
|
||||
-- Loop over all airbases.
|
||||
for _,_airbase in pairs(airbases) do
|
||||
local airbase=_airbase --Wrapper.Airbase#AIRBASE
|
||||
local category=airbase:GetDesc().category
|
||||
if Category and Category==category or Category==nil then
|
||||
local dist=self:Get2DDistance(airbase:GetCoordinate())
|
||||
if closest==nil then
|
||||
distmin=dist
|
||||
closest=airbase
|
||||
else
|
||||
if dist<distmin then
|
||||
if airbase then
|
||||
local category=airbase:GetCategory()
|
||||
if Category and Category==category or Category==nil then
|
||||
local dist=self:Get2DDistance(airbase:GetCoordinate())
|
||||
if closest==nil then
|
||||
distmin=dist
|
||||
closest=airbase
|
||||
end
|
||||
else
|
||||
if dist<distmin then
|
||||
distmin=dist
|
||||
closest=airbase
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user