mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
small changes Legion & Auftrag
This commit is contained in:
parent
72999cc7b0
commit
72550d6d84
@ -4239,12 +4239,18 @@ function AUFTRAG:_TargetFromObject(Object)
|
||||
|
||||
self.engageTarget=Object
|
||||
|
||||
else
|
||||
elseif Object then
|
||||
|
||||
self.engageTarget=TARGET:New(Object)
|
||||
|
||||
end
|
||||
|
||||
if self.type == AUFTRAG.Type.ALERT5 then
|
||||
|
||||
self.alert5Target = self.engageTarget
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
-- Target was already specified elsewhere.
|
||||
@ -4372,6 +4378,11 @@ function AUFTRAG:GetTargetCoordinate()
|
||||
local coord=self.engageTarget:GetCoordinate()
|
||||
return coord
|
||||
|
||||
elseif self.alert5Target then
|
||||
|
||||
local coord=self.alert5Target:GetCoordinate()
|
||||
return coord
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cannot get target coordinate!")
|
||||
end
|
||||
|
||||
@ -2005,7 +2005,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
||||
end
|
||||
|
||||
-- Now we have a long list with assets.
|
||||
LEGION._OptimizeAssetSelection(Assets, MissionTypeOpt, TargetVec2, false)
|
||||
LEGION._OptimizeAssetSelection(Assets, MissionTypeRecruit, TargetVec2, false)
|
||||
|
||||
|
||||
-- Get payloads for air assets.
|
||||
@ -2016,7 +2016,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
||||
if asset.legion:IsAirwing() and not asset.payload then
|
||||
|
||||
-- Fetch payload for asset. This can be nil!
|
||||
asset.payload=asset.legion:FetchPayloadFromStock(asset.unittype, MissionTypeOpt, Payloads)
|
||||
asset.payload=asset.legion:FetchPayloadFromStock(asset.unittype, MissionTypeRecruit, Payloads)
|
||||
|
||||
end
|
||||
end
|
||||
@ -2030,7 +2030,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
||||
end
|
||||
|
||||
-- Now find the best asset for the given payloads.
|
||||
LEGION._OptimizeAssetSelection(Assets, MissionTypeOpt, TargetVec2, true)
|
||||
LEGION._OptimizeAssetSelection(Assets, MissionTypeRecruit, TargetVec2, true)
|
||||
|
||||
-- Number of assets. At most NreqMax.
|
||||
local Nassets=math.min(#Assets, NreqMax)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user