mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
bfd26522d6
@ -2082,13 +2082,15 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
||||
--self:F( { AirbaseCategory = AirbaseCategory } )
|
||||
|
||||
-- Set airdrome ID. For helipads and ships we need to add the helipad ID and linked unit.
|
||||
SpawnPoint.airdromeId = AirbaseID
|
||||
-- Note, it is important not to set the airdrome ID for at least ships, because spawn will happen at origin of the map
|
||||
if AirbaseCategory == Airbase.Category.SHIP then
|
||||
SpawnPoint.linkUnit = AirbaseID
|
||||
SpawnPoint.helipadId = AirbaseID
|
||||
elseif AirbaseCategory == Airbase.Category.HELIPAD then
|
||||
SpawnPoint.linkUnit = AirbaseID
|
||||
SpawnPoint.helipadId = AirbaseID
|
||||
else
|
||||
SpawnPoint.airdromeId = AirbaseID
|
||||
end
|
||||
|
||||
-- Set waypoint type/action.
|
||||
|
||||
@ -445,6 +445,21 @@ function LEGION:DelCohort(Cohort)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Remove specific asset from legion.
|
||||
-- @param #LEGION self
|
||||
-- @param Functional.Warehouse#WAREHOUSE.Assetitem Asset The asset.
|
||||
-- @return #LEGION self
|
||||
function LEGION:DelAsset(Asset)
|
||||
|
||||
if Asset.cohort then
|
||||
Asset.cohort:DelAsset(Asset)
|
||||
else
|
||||
self:E(self.lid..string.format("ERROR: Asset has not cohort attached. Cannot remove it from legion!"))
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Relocate a cohort to another legion.
|
||||
-- Assets in stock are spawned and routed to the new legion.
|
||||
@ -1644,6 +1659,9 @@ function LEGION:onafterAssetDead(From, Event, To, asset, request)
|
||||
self.commander.chief.detectionset:RemoveGroupsByName({asset.spawngroupname})
|
||||
end
|
||||
|
||||
-- Remove asset from cohort and legion.
|
||||
self:DelAsset(asset)
|
||||
|
||||
-- Remove asset from mission is done via Mission:AssetDead() call from flightgroup onafterFlightDead function
|
||||
-- Remove asset from squadron same
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user