- Fixed refuel system always true.
This commit is contained in:
Frank 2021-11-13 20:08:22 +01:00
parent a8132552de
commit b9b5938a91
2 changed files with 14 additions and 2 deletions

View File

@ -75,7 +75,7 @@ COHORT = {
--- COHORT class version.
-- @field #string version
COHORT.version="0.0.2"
COHORT.version="0.1.0"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list

View File

@ -1947,7 +1947,19 @@ function LEGION.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt,
local InRange=(RangeMax and math.max(RangeMax, cohort.engageRange) or cohort.engageRange) >= TargetDistance
-- Has the requested refuelsystem?
local Refuel=RefuelSystem and RefuelSystem==cohort.tankerSystem or true
local Refuel=RefuelSystem~=nil and (RefuelSystem==cohort.tankerSystem) or true
-- STRANGE: Why did the above line did not give the same result?! Above Refuel is always true!
local Refuel=true
if RefuelSystem then
if cohort.tankerSystem then
Refuel=RefuelSystem==cohort.tankerSystem
else
Refuel=false
end
end
--env.info(string.format("Cohort=%s: RefuelSystem=%s, TankerSystem=%s ==> Refuel=%s", cohort.name, tostring(RefuelSystem), tostring(cohort.tankerSystem), tostring(Refuel)))
-- Is capable of the mission type?
local Capable=AUFTRAG.CheckMissionCapability({MissionTypeRecruit}, cohort.missiontypes)