From 1911c608bbec5a97183fe2fad8f99c2715d46163 Mon Sep 17 00:00:00 2001 From: Ciaran Fisher Date: Sat, 13 Nov 2021 21:18:41 +0000 Subject: [PATCH] Fixed HAWK not firing Thanks to Grimes! --- CTLD.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CTLD.lua b/CTLD.lua index d992049..37db696 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -4179,7 +4179,20 @@ function ctld.spawnCrateGroup(_heli, _positions, _types) local _dest = _spawnedGroup:getUnit(1):getPoint() _dest = { x = _dest.x + 0.5, _y = _dest.y + 0.5, z = _dest.z + 0.5 } - ctld.orderGroupToMoveToPoint(_spawnedGroup:getUnit(1), _dest) + --ctld.orderGroupToMoveToPoint(_spawnedGroup:getUnit(1), _dest) + + + -- delayed 2 second to work around bug + timer.scheduleFunction(function(_arg) + local _grp = ctld.getAliveGroup(_arg[1]) + + if _grp ~= nil then + 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, AI.Option.Ground.val.ROE.OPEN_FIRE) + end + end + , {_groupName}, timer.getTime() + 2) return _spawnedGroup end