diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 0b45243e1..7cb688283 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -4239,10 +4239,16 @@ 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 @@ -4372,7 +4378,12 @@ function AUFTRAG:GetTargetCoordinate() local coord=self.engageTarget:GetCoordinate() return coord - else + elseif self.alert5Target then + + local coord=self.alert5Target:GetCoordinate() + return coord + + else self:E(self.lid.."ERROR: Cannot get target coordinate!") end diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index 0c47e609e..a62212cd8 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -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)