mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Formatting
This commit is contained in:
parent
5de863fbb8
commit
1c609e1b70
@ -2928,29 +2928,29 @@ end
|
||||
|
||||
function SkynetIADSAbstractRadarElement:informOfHARM(harmContact)
|
||||
local radars = self:getRadars()
|
||||
for j = 1, #radars do
|
||||
local radar = radars[j]
|
||||
if radar:isExist() then
|
||||
local distanceNM = mist.utils.metersToNM(self:getDistanceInMetersToContact(radar, harmContact:getPosition().p))
|
||||
local harmToSAMHeading = mist.utils.toDegree(mist.utils.getHeadingPoints(harmContact:getPosition().p, radar:getPosition().p))
|
||||
local harmToSAMAspect = self:calculateAspectInDegrees(harmContact:getMagneticHeading(), harmToSAMHeading)
|
||||
local speedKT = harmContact:getGroundSpeedInKnots(0)
|
||||
local secondsToImpact = self:getSecondsToImpact(distanceNM, speedKT)
|
||||
--TODO: use tti instead of distanceNM?
|
||||
-- when iterating through the radars, store shortest tti and work with that value??
|
||||
if ( harmToSAMAspect < SkynetIADSAbstractRadarElement.HARM_TO_SAM_ASPECT and distanceNM < SkynetIADSAbstractRadarElement.HARM_LOOKAHEAD_NM ) then
|
||||
self:addObjectIdentifiedAsHARM(harmContact)
|
||||
if ( #self:getPointDefences() > 0 and self:pointDefencesGoLive() == true and self.iads:getDebugSettings().harmDefence ) then
|
||||
self.iads:printOutputToLog("POINT DEFENCES GOING LIVE FOR: "..self:getDCSName().." | TTI: "..secondsToImpact)
|
||||
end
|
||||
--self.iads:printOutputToLog("Ignore HARM shutdown: "..tostring(self:shallIgnoreHARMShutdown()))
|
||||
if ( self:getIsAPointDefence() == false and ( self:isDefendingHARM() == false or ( self:getHARMShutdownTime() < secondsToImpact ) ) and self:shallIgnoreHARMShutdown() == false) then
|
||||
self:goSilentToEvadeHARM(secondsToImpact)
|
||||
break
|
||||
end
|
||||
for j = 1, #radars do
|
||||
local radar = radars[j]
|
||||
if radar:isExist() then
|
||||
local distanceNM = mist.utils.metersToNM(self:getDistanceInMetersToContact(radar, harmContact:getPosition().p))
|
||||
local harmToSAMHeading = mist.utils.toDegree(mist.utils.getHeadingPoints(harmContact:getPosition().p, radar:getPosition().p))
|
||||
local harmToSAMAspect = self:calculateAspectInDegrees(harmContact:getMagneticHeading(), harmToSAMHeading)
|
||||
local speedKT = harmContact:getGroundSpeedInKnots(0)
|
||||
local secondsToImpact = self:getSecondsToImpact(distanceNM, speedKT)
|
||||
--TODO: use tti instead of distanceNM?
|
||||
-- when iterating through the radars, store shortest tti and work with that value??
|
||||
if ( harmToSAMAspect < SkynetIADSAbstractRadarElement.HARM_TO_SAM_ASPECT and distanceNM < SkynetIADSAbstractRadarElement.HARM_LOOKAHEAD_NM ) then
|
||||
self:addObjectIdentifiedAsHARM(harmContact)
|
||||
if ( #self:getPointDefences() > 0 and self:pointDefencesGoLive() == true and self.iads:getDebugSettings().harmDefence ) then
|
||||
self.iads:printOutputToLog("POINT DEFENCES GOING LIVE FOR: "..self:getDCSName().." | TTI: "..secondsToImpact)
|
||||
end
|
||||
--self.iads:printOutputToLog("Ignore HARM shutdown: "..tostring(self:shallIgnoreHARMShutdown()))
|
||||
if ( self:getIsAPointDefence() == false and ( self:isDefendingHARM() == false or ( self:getHARMShutdownTime() < secondsToImpact ) ) and self:shallIgnoreHARMShutdown() == false) then
|
||||
self:goSilentToEvadeHARM(secondsToImpact)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SkynetIADSAbstractElement:addObjectIdentifiedAsHARM(harmContact)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user