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)
|
function SkynetIADSAbstractRadarElement:informOfHARM(harmContact)
|
||||||
local radars = self:getRadars()
|
local radars = self:getRadars()
|
||||||
for j = 1, #radars do
|
for j = 1, #radars do
|
||||||
local radar = radars[j]
|
local radar = radars[j]
|
||||||
if radar:isExist() then
|
if radar:isExist() then
|
||||||
local distanceNM = mist.utils.metersToNM(self:getDistanceInMetersToContact(radar, harmContact:getPosition().p))
|
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 harmToSAMHeading = mist.utils.toDegree(mist.utils.getHeadingPoints(harmContact:getPosition().p, radar:getPosition().p))
|
||||||
local harmToSAMAspect = self:calculateAspectInDegrees(harmContact:getMagneticHeading(), harmToSAMHeading)
|
local harmToSAMAspect = self:calculateAspectInDegrees(harmContact:getMagneticHeading(), harmToSAMHeading)
|
||||||
local speedKT = harmContact:getGroundSpeedInKnots(0)
|
local speedKT = harmContact:getGroundSpeedInKnots(0)
|
||||||
local secondsToImpact = self:getSecondsToImpact(distanceNM, speedKT)
|
local secondsToImpact = self:getSecondsToImpact(distanceNM, speedKT)
|
||||||
--TODO: use tti instead of distanceNM?
|
--TODO: use tti instead of distanceNM?
|
||||||
-- when iterating through the radars, store shortest tti and work with that value??
|
-- 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
|
if ( harmToSAMAspect < SkynetIADSAbstractRadarElement.HARM_TO_SAM_ASPECT and distanceNM < SkynetIADSAbstractRadarElement.HARM_LOOKAHEAD_NM ) then
|
||||||
self:addObjectIdentifiedAsHARM(harmContact)
|
self:addObjectIdentifiedAsHARM(harmContact)
|
||||||
if ( #self:getPointDefences() > 0 and self:pointDefencesGoLive() == true and self.iads:getDebugSettings().harmDefence ) then
|
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)
|
self.iads:printOutputToLog("POINT DEFENCES GOING LIVE FOR: "..self:getDCSName().." | TTI: "..secondsToImpact)
|
||||||
end
|
end
|
||||||
--self.iads:printOutputToLog("Ignore HARM shutdown: "..tostring(self:shallIgnoreHARMShutdown()))
|
--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
|
if ( self:getIsAPointDefence() == false and ( self:isDefendingHARM() == false or ( self:getHARMShutdownTime() < secondsToImpact ) ) and self:shallIgnoreHARMShutdown() == false) then
|
||||||
self:goSilentToEvadeHARM(secondsToImpact)
|
self:goSilentToEvadeHARM(secondsToImpact)
|
||||||
break
|
break
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SkynetIADSAbstractElement:addObjectIdentifiedAsHARM(harmContact)
|
function SkynetIADSAbstractElement:addObjectIdentifiedAsHARM(harmContact)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user