This commit is contained in:
Frank
2020-04-29 16:09:11 +02:00
parent b2a903e077
commit c8d2104c39
2 changed files with 13 additions and 6 deletions
+7 -5
View File
@@ -327,12 +327,11 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType)
return nil
end
--[[
self:I(self.lid..string.format("Looking for payload for unit type=%s and mission type=%s", UnitType, MissionType))
for i,_payload in pairs(self.payloads) do
local payload=_payload --#AIRWING.Payload
self:I(self.lid..string.format("%d Payload type=%s navail=%d", i, payload.aircrafttype, payload.navail))
self:I(self.lid..string.format("[%d] Payload type=%s navail=%d unlimited=%s", i, payload.aircrafttype, payload.navail, tostring(payload.unlimited)))
end
]]
--- Sort payload wrt the following criteria:
-- 1) Highest performance is the main selection criterion.
@@ -346,13 +345,16 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType)
local performanceB=self:GetPayloadPeformance(b, MissionType)
return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail)
elseif not a then
env.info("FF ERROR in sortpayloads: a is nil")
return false
elseif not b then
env.info("FF ERROR in sortpayloads: b is nil")
return true
else
return true
env.info("FF ERROR in sortpayloads: a and b are nil")
return false
end
end
end
table.sort(self.payloads, sortpayloads)
if self.Debug then
+6 -1
View File
@@ -114,7 +114,12 @@
-- # The AUFTRAG Concept
--
-- As you probably know, setting tasks in DCS is often tedious. The AUFTRAG class significantly simplifies the necessary workflow by using optimized default parameters.
-- Also, a lot of additional useful events are created.
--
-- You can think of an AUFTRAG as document, which contains the mission briefing, i.e. information about the target location, mission altitude, speed and various other parameters.
-- This document can be handed over directly to a pilot (or multiple pilots) via the
-- FLIGHTGROUP class. The pilots will then execute the mission. The AUFTRAG document can also be given to an AIRWING. The airwing will then determine the best assets
-- (pilots and payloads) available for the job. One more up the food chain, an AUFTRAG can be passed to a WINGCOMMANDER. The wing commander will find the best AIRWING
-- and pass the job over to it.
--
-- # Mission Types
--