INTEL - also set isship and isground attributes on contacts

This commit is contained in:
Applevangelist 2021-10-01 10:44:25 +02:00
parent 53e98e70aa
commit 17ba35e237

View File

@ -748,6 +748,8 @@ function INTEL:CreateDetectedItems(DetectedGroups, RecceDetecting)
item.velocity=group:GetVelocityVec3()
item.speed=group:GetVelocityMPS()
item.recce=RecceDetecting[groupname]
item.isground = group:IsGround() or false
item.isship = group:IsShip() or false
self:T(string.format("%s group detect by %s/%s", groupname, RecceDetecting[groupname] or "unknown", item.recce or "unknown"))
-- Add contact to table.
self:AddContact(item)
@ -792,8 +794,8 @@ end
function INTEL:GetDetectedUnits(Unit, DetectedUnits, RecceDetecting, DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)
-- Get detected DCS units.
local detectedtargets=Unit:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)
local reccename = Unit:GetName()
local detectedtargets=Unit:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)
for DetectionObjectID, Detection in pairs(detectedtargets or {}) do
local DetectedObject=Detection.object -- DCS#Object