mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-17 20:56:03 +00:00
Check if unit exists before trying to get it's position etc.
This commit is contained in:
@@ -5482,6 +5482,7 @@ function ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)
|
|||||||
|
|
||||||
local _spots = {}
|
local _spots = {}
|
||||||
|
|
||||||
|
if _enemyUnit:isExist() then
|
||||||
local _enemyVector = _enemyUnit:getPoint()
|
local _enemyVector = _enemyUnit:getPoint()
|
||||||
local _enemyVectorUpdated = { x = _enemyVector.x, y = _enemyVector.y + 2.0, z = _enemyVector.z }
|
local _enemyVectorUpdated = { x = _enemyVector.x, y = _enemyVector.y + 2.0, z = _enemyVector.z }
|
||||||
|
|
||||||
@@ -5555,6 +5556,7 @@ function ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- get currently selected unit and check they're still in range
|
-- get currently selected unit and check they're still in range
|
||||||
function ctld.getCurrentUnit(_jtacUnit, _jtacGroupName)
|
function ctld.getCurrentUnit(_jtacUnit, _jtacGroupName)
|
||||||
|
|||||||
Reference in New Issue
Block a user