mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Update Skynet plugin to 3.0.1
This commit is contained in:
parent
fdac9e99e1
commit
91100a75db
@ -1,4 +1,4 @@
|
|||||||
env.info("--- SKYNET VERSION: 3.0.0 | BUILD TIME: 23.07.2022 1512Z ---")
|
env.info("--- SKYNET VERSION: 3.0.1 | BUILD TIME: 06.11.2022 1728Z ---")
|
||||||
do
|
do
|
||||||
--this file contains the required units per sam type
|
--this file contains the required units per sam type
|
||||||
samTypesDB = {
|
samTypesDB = {
|
||||||
@ -3450,7 +3450,7 @@ function SkynetIADSSAMSearchRadar:setupRangeData()
|
|||||||
local sensorInformation = subEntries[j]
|
local sensorInformation = subEntries[j]
|
||||||
-- some sam sites have IR and passive EWR detection, we are just interested in the radar data
|
-- some sam sites have IR and passive EWR detection, we are just interested in the radar data
|
||||||
-- investigate if upperHemisphere and headOn is ok, I guess it will work for most detection cases
|
-- investigate if upperHemisphere and headOn is ok, I guess it will work for most detection cases
|
||||||
if sensorInformation.type == Unit.SensorType.RADAR then
|
if sensorInformation.type == Unit.SensorType.RADAR and sensorInformation['detectionDistanceAir'] then
|
||||||
local upperHemisphere = sensorInformation['detectionDistanceAir']['upperHemisphere']['headOn']
|
local upperHemisphere = sensorInformation['detectionDistanceAir']['upperHemisphere']['headOn']
|
||||||
local lowerHemisphere = sensorInformation['detectionDistanceAir']['lowerHemisphere']['headOn']
|
local lowerHemisphere = sensorInformation['detectionDistanceAir']['lowerHemisphere']['headOn']
|
||||||
self.maximumRange = upperHemisphere
|
self.maximumRange = upperHemisphere
|
||||||
@ -3509,9 +3509,23 @@ function SkynetIADSSamSite:create(samGroup, iads)
|
|||||||
setmetatable(sam, self)
|
setmetatable(sam, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
sam.targetsInRange = false
|
sam.targetsInRange = false
|
||||||
|
sam.goLiveConstraints = {}
|
||||||
return sam
|
return sam
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SkynetIADSSamSite:addGoLiveConstraint(constraintName, constraint)
|
||||||
|
self.goLiveConstraints[constraintName] = constraint
|
||||||
|
end
|
||||||
|
|
||||||
|
function SkynetIADSAbstractRadarElement:areGoLiveConstraintsSatisfied(contact)
|
||||||
|
for constraintName, constraint in pairs(self.goLiveConstraints) do
|
||||||
|
if ( constraint(contact) ~= true ) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
function SkynetIADSSamSite:isDestroyed()
|
function SkynetIADSSamSite:isDestroyed()
|
||||||
local isDestroyed = true
|
local isDestroyed = true
|
||||||
for i = 1, #self.launchers do
|
for i = 1, #self.launchers do
|
||||||
@ -3542,7 +3556,7 @@ end
|
|||||||
|
|
||||||
function SkynetIADSSamSite:informOfContact(contact)
|
function SkynetIADSSamSite:informOfContact(contact)
|
||||||
-- we make sure isTargetInRange (expensive call) is only triggered if no previous calls to this method resulted in targets in range
|
-- we make sure isTargetInRange (expensive call) is only triggered if no previous calls to this method resulted in targets in range
|
||||||
if ( self.targetsInRange == false and self:isTargetInRange(contact) and ( contact:isIdentifiedAsHARM() == false or ( contact:isIdentifiedAsHARM() == true and self:getCanEngageHARM() == true ) ) ) then
|
if ( self.targetsInRange == false and self:areGoLiveConstraintsSatisfied(contact) == true and self:isTargetInRange(contact) and ( contact:isIdentifiedAsHARM() == false or ( contact:isIdentifiedAsHARM() == true and self:getCanEngageHARM() == true ) ) ) then
|
||||||
self:goLive()
|
self:goLive()
|
||||||
self.targetsInRange = true
|
self.targetsInRange = true
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user