mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
Show & refresh fct returns targetsInLOS table
This commit is contained in:
9
CTLD.lua
9
CTLD.lua
@@ -7287,6 +7287,8 @@ end
|
|||||||
function ctld.showTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius) -- _unitObject targeting
|
function ctld.showTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius) -- _unitObject targeting
|
||||||
-- _searchRadius and _markRadius in meters
|
-- _searchRadius and _markRadius in meters
|
||||||
if _unitObject then
|
if _unitObject then
|
||||||
|
local TargetsInLOS = {}
|
||||||
|
|
||||||
local enemyCoa = 1
|
local enemyCoa = 1
|
||||||
local enemyColor = "red"
|
local enemyColor = "red"
|
||||||
local color = {1, 0, 0, 0.2} -- red
|
local color = {1, 0, 0, 0.2} -- red
|
||||||
@@ -7307,13 +7309,14 @@ function ctld.showTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius)
|
|||||||
ctld.lastMarkId = ctld.lastMarkId + 1
|
ctld.lastMarkId = ctld.lastMarkId + 1
|
||||||
trigger.action.circleToAll(_unitObject:getCoalition(), ctld.lastMarkId, targetPoint, _markRadius , color, color, 1, false, nil)
|
trigger.action.circleToAll(_unitObject:getCoalition(), ctld.lastMarkId, targetPoint, _markRadius , color, color, 1, false, nil)
|
||||||
MarkIds[#MarkIds+1] = ctld.lastMarkId
|
MarkIds[#MarkIds+1] = ctld.lastMarkId
|
||||||
|
TargetsInLOS[#TargetsInLOS+1] = {targetObject=t[i].vis[j]:getName(), targetTypeName=t[i].vis[j]:getTypeName(), targetPoint=targetPoint}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mist.DBs.humansByName[_unitObject:getName()].losMarkIds = MarkIds -- store list of marksIds generated and show on F10 map
|
mist.DBs.humansByName[_unitObject:getName()].losMarkIds = MarkIds -- store list of marksIds generated and show on F10 map
|
||||||
return true
|
return TargetsInLOS
|
||||||
else
|
else
|
||||||
return false
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
@@ -7329,7 +7332,7 @@ end
|
|||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
function ctld.refreshTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius)
|
function ctld.refreshTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius)
|
||||||
ctld.removeTargetsInLosOnF10Map(_unitObject)
|
ctld.removeTargetsInLosOnF10Map(_unitObject)
|
||||||
ctld.showTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius)
|
return ctld.showTargetsInLosOnF10Map(_unitObject, _searchRadius, _markRadius) -- returns TargetsInLOS table
|
||||||
end
|
end
|
||||||
--- test ------------------------------------------------------
|
--- test ------------------------------------------------------
|
||||||
--"uh1-1" --"uh2-1"
|
--"uh1-1" --"uh2-1"
|
||||||
|
|||||||
Reference in New Issue
Block a user