diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index b5e809816..6f2142436 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -600,7 +600,7 @@ do self.maxlongrange = 1 self.maxmidrange = 2 self.maxshortrange = 2 - self.maxpointdefrange =6 + self.maxpointdefrange = 6 self.maxclassic = 6 self.autoshorad = true self.ShoradGroupSet = SET_GROUP:New() -- Core.Set#SET_GROUP @@ -2188,7 +2188,7 @@ do local Shorad = self.Shorad local radius = self.checkradius local ontime = self.ShoradTime - Shorad:WakeUpShorad(Name, radius, ontime) + Shorad:WakeUpShorad(Name, radius, ontime, nil, true) self:__ShoradActivated(1,Name, radius, ontime) end return self diff --git a/Moose Development/Moose/Functional/Shorad.lua b/Moose Development/Moose/Functional/Shorad.lua index 68ffe9c56..01b90262e 100644 --- a/Moose Development/Moose/Functional/Shorad.lua +++ b/Moose Development/Moose/Functional/Shorad.lua @@ -472,6 +472,7 @@ do -- @param #number Radius Radius of the #ZONE -- @param #number ActiveTimer Number of seconds to stay active -- @param #number TargetCat (optional) Category, i.e. Object.Category.UNIT or Object.Category.STATIC + -- @param #boolean ShotAt If true, function is called after a shot -- @return #SHORAD self -- @usage Use this function to integrate with other systems, example -- @@ -481,7 +482,7 @@ do -- mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs") -- mymantis:AddShorad(myshorad,720) -- mymantis:Start() - function SHORAD:onafterWakeUpShorad(From, Event, To, TargetGroup, Radius, ActiveTimer, TargetCat) + function SHORAD:onafterWakeUpShorad(From, Event, To, TargetGroup, Radius, ActiveTimer, TargetCat, ShotAt) self:T(self.lid .. " WakeUpShorad") self:T({TargetGroup, Radius, ActiveTimer, TargetCat}) local targetcat = TargetCat or Object.Category.UNIT @@ -526,7 +527,7 @@ do local groupname = _group:GetName() - if groupname == TargetGroup then + if groupname == TargetGroup and ShotAt==true then -- Shot at a SHORAD group if self.UseEmOnOff then _group:EnableEmission(false) @@ -628,7 +629,7 @@ do _targetgroupname = tgtgrp:GetName() -- group name _targetskill = tgtgrp:GetUnit(1):GetSkill() self:T("*** Found Target = ".. _targetgroupname) - self:WakeUpShorad(_targetgroupname, self.Radius, self.ActiveTimer, Object.Category.UNIT) + self:WakeUpShorad(_targetgroupname, self.Radius, self.ActiveTimer, Object.Category.UNIT,true) end end end @@ -757,7 +758,7 @@ do -- if being shot at, find closest SHORADs to activate if shotatsams or shotatus then self:T({shotatsams=shotatsams,shotatus=shotatus}) - self:WakeUpShorad(targetgroupname, self.Radius, self.ActiveTimer, targetcat) + self:WakeUpShorad(targetgroupname, self.Radius, self.ActiveTimer, targetcat, true) end end end