mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
hardened the code to avoid a nil value in ctld.setGrpROE
This commit is contained in:
parent
ebf72aaa44
commit
55846e3109
4
CTLD.lua
4
CTLD.lua
@ -6770,9 +6770,7 @@ function ctld.setGrpROE(_grp, _ROE)
|
||||
_ROE = AI.Option.Ground.val.ROE.OPEN_FIRE
|
||||
end
|
||||
|
||||
_grp = ctld.getAliveGroup(_grp)
|
||||
|
||||
if _grp ~= nil then
|
||||
if _grp and _grp:isExist() == true and #_grp:getUnits() > 0 then -- check if the group truly exists
|
||||
local _controller = _grp:getController();
|
||||
Controller.setOption(_controller, AI.Option.Ground.id.ALARM_STATE, AI.Option.Ground.val.ALARM_STATE.AUTO)
|
||||
Controller.setOption(_controller, AI.Option.Ground.id.ROE, _ROE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user