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
|
self.engageTarget=Object
|
||||||
|
|
||||||
else
|
elseif Object then
|
||||||
|
|
||||||
self.engageTarget=TARGET:New(Object)
|
self.engageTarget=TARGET:New(Object)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.type == AUFTRAG.Type.ALERT5 then
|
||||||
|
|
||||||
|
self.alert5Target = self.engageTarget
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
-- Target was already specified elsewhere.
|
-- Target was already specified elsewhere.
|
||||||
@ -4372,6 +4378,11 @@ function AUFTRAG:GetTargetCoordinate()
|
|||||||
local coord=self.engageTarget:GetCoordinate()
|
local coord=self.engageTarget:GetCoordinate()
|
||||||
return coord
|
return coord
|
||||||
|
|
||||||
|
elseif self.alert5Target then
|
||||||
|
|
||||||
|
local coord=self.alert5Target:GetCoordinate()
|
||||||
|
return coord
|
||||||
|
|
||||||
else
|
else
|
||||||
self:E(self.lid.."ERROR: Cannot get target coordinate!")
|
self:E(self.lid.."ERROR: Cannot get target coordinate!")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2005,7 +2005,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Now we have a long list with assets.
|
-- 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.
|
-- Get payloads for air assets.
|
||||||
@ -2016,7 +2016,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
|||||||
if asset.legion:IsAirwing() and not asset.payload then
|
if asset.legion:IsAirwing() and not asset.payload then
|
||||||
|
|
||||||
-- Fetch payload for asset. This can be nil!
|
-- 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
|
||||||
end
|
end
|
||||||
@ -2030,7 +2030,7 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Now find the best asset for the given payloads.
|
-- 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.
|
-- Number of assets. At most NreqMax.
|
||||||
local Nassets=math.min(#Assets, NreqMax)
|
local Nassets=math.min(#Assets, NreqMax)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user