From acfbec1e84b68b4acb9ece3189e36c2729a52719 Mon Sep 17 00:00:00 2001 From: Jason Montleon Date: Sat, 20 Feb 2016 11:09:46 -0500 Subject: [PATCH] add a way to stop JTACS from lasing --- CTLD.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CTLD.lua b/CTLD.lua index 1706058..5fec654 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -4330,6 +4330,7 @@ ctld.jtacLaserPoints = {} ctld.jtacIRPoints = {} ctld.jtacSmokeMarks = {} ctld.jtacUnits = {} -- list of JTAC units for f10 command +ctld.jtacStop = {} -- jtacs to tell to stop lasing ctld.jtacCurrentTargets = {} ctld.jtacRadioAdded = {} --keeps track of who's had the radio command added ctld.jtacGeneratedLaserCodes = {} -- keeps track of generated codes, cycles when they run out @@ -4338,6 +4339,12 @@ ctld.jtacLaserPointCodes = {} function ctld.JTACAutoLase(_jtacGroupName, _laserCode, _smoke, _lock, _colour) + if ctld.jtacStop[_jtacGroupName] == true then + ctld.jtacStop[_jtacGroupName] = nil + ctld.cleanupJTAC(_jtacGroupName) + return + end + if _lock == nil then _lock = ctld.JTAC_lock @@ -4501,6 +4508,9 @@ function ctld.JTACAutoLase(_jtacGroupName, _laserCode, _smoke, _lock, _colour) end end +function ctld.JTACAutoLaseStop(_jtacGroupName) + ctld.jtacStop[_jtacGroupName] = true +end -- used by the timer function function ctld.timerJTACAutoLase(_args) @@ -5359,4 +5369,4 @@ env.info("CTLD READY") -- for key, value in pairs(getmetatable(_spawnedCrate)) do -- env.info(tostring(key)) -- env.info(tostring(value)) --- end \ No newline at end of file +-- end