Configure skynet point defenses.

Fixes https://github.com/Khopa/dcs_liberation/issues/470
This commit is contained in:
Dan Albert 2020-12-24 17:10:32 -08:00
parent 85619b156d
commit cd6620712f

View File

@ -89,7 +89,21 @@ if dcsLiberation and SkynetIADS then
end
end
-- TODO: Add ships.
local sites = iads:getSAMSites()
for i = 1, #sites do
local site = sites[i]
local name = site:getDCSName()
if not string.match(name, "|PD") then
env.info(string.format("DCSLiberation|Skynet-IADS plugin - Checking %s for PD", name))
local pds = iads:getSAMSitesByPrefix(name .. "|PD")
for j = 1, #pds do
pd = pds[j]
env.info(string.format("DCSLiberation|Skynet-IADS plugin - Adding %s as PD for %s", pd:getDCSName(), name))
site:addPointDefence(pd)
site:setIgnoreHARMSWhilePointDefencesHaveAmmo(true)
end
end
end
if inRadio then
--activate the radio menu to toggle IADS Status output