mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update Cohort.lua
- Fixed some stuff for combat readiness check
This commit is contained in:
parent
0b5edfc21f
commit
316ea910c2
@ -831,34 +831,52 @@ function COHORT:RecruitAssets(Mission, Npayloads)
|
|||||||
|
|
||||||
local flightgroup=asset.flightgroup
|
local flightgroup=asset.flightgroup
|
||||||
|
|
||||||
-- Firstly, check if it has the right payload.
|
|
||||||
if self:CheckMissionCapability(Mission.type, asset.payload.capabilities) and flightgroup and flightgroup:IsAlive() then
|
if flightgroup and flightgroup:IsAlive() then
|
||||||
|
|
||||||
-- Assume we are ready and check if any condition tells us we are not.
|
-- Assume we are ready and check if any condition tells us we are not.
|
||||||
local combatready=true
|
local combatready=true
|
||||||
|
|
||||||
if Mission.type==AUFTRAG.Type.INTERCEPT then
|
-- Check if in a state where we really do not want to fight any more.
|
||||||
combatready=flightgroup:CanAirToAir()
|
if flightgroup:IsFlightgroup() then
|
||||||
else
|
|
||||||
local excludeguns=Mission.type==AUFTRAG.Type.BOMBING or Mission.type==AUFTRAG.Type.BOMBRUNWAY or Mission.type==AUFTRAG.Type.BOMBCARPET or Mission.type==AUFTRAG.Type.SEAD or Mission.type==AUFTRAG.Type.ANTISHIP
|
---
|
||||||
combatready=flightgroup:CanAirToGround(excludeguns)
|
-- FLIGHTGROUP combat ready?
|
||||||
end
|
---
|
||||||
|
|
||||||
-- No more attacks if fuel is already low. Safety first!
|
-- No more attacks if fuel is already low. Safety first!
|
||||||
if flightgroup:IsFuelLow() then
|
if flightgroup:IsFuelLow() then
|
||||||
combatready=false
|
combatready=false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if in a state where we really do not want to fight any more.
|
if Mission.type==AUFTRAG.Type.INTERCEPT and not flightgroup:CanAirToAir() then
|
||||||
if flightgroup:IsFlightgroup() then
|
combatready=false
|
||||||
|
else
|
||||||
|
local excludeguns=Mission.type==AUFTRAG.Type.BOMBING or Mission.type==AUFTRAG.Type.BOMBRUNWAY or Mission.type==AUFTRAG.Type.BOMBCARPET or Mission.type==AUFTRAG.Type.SEAD or Mission.type==AUFTRAG.Type.ANTISHIP
|
||||||
|
if excludeguns and not flightgroup:CanAirToGround(excludeguns) then
|
||||||
|
combatready=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if flightgroup:IsHolding() or flightgroup:IsLanding() or flightgroup:IsLanded() or flightgroup:IsArrived() then
|
if flightgroup:IsHolding() or flightgroup:IsLanding() or flightgroup:IsLanded() or flightgroup:IsArrived() then
|
||||||
combatready=false
|
combatready=false
|
||||||
end
|
end
|
||||||
|
if asset.payload and not self:CheckMissionCapability(Mission.type, asset.payload.capabilities) then
|
||||||
|
combatready=false
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
---
|
||||||
|
-- ARMY/NAVYGROUP combat ready?
|
||||||
|
---
|
||||||
|
|
||||||
if flightgroup:IsRearming() or flightgroup:IsRetreating() or flightgroup:IsReturning() then
|
if flightgroup:IsRearming() or flightgroup:IsRetreating() or flightgroup:IsReturning() then
|
||||||
combatready=false
|
combatready=false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Applies to all opsgroups.
|
-- Applies to all opsgroups.
|
||||||
if flightgroup:IsDead() or flightgroup:IsStopped() then
|
if flightgroup:IsDead() or flightgroup:IsStopped() then
|
||||||
combatready=false
|
combatready=false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user