mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-23 17:56:05 +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 = {}
|
||||
|
||||
if _enemyUnit:isExist() then
|
||||
local _enemyVector = _enemyUnit:getPoint()
|
||||
local _enemyVectorUpdated = { x = _enemyVector.x, y = _enemyVector.y + 2.0, z = _enemyVector.z }
|
||||
|
||||
@@ -5554,6 +5555,7 @@ function ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)
|
||||
_oldIR:setPoint(_enemyVectorUpdated)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- get currently selected unit and check they're still in range
|
||||
|
||||
Reference in New Issue
Block a user