From ab13b5f198ba58253bc91580464c6ddb6e9a6645 Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 10 Nov 2022 00:36:02 +0100 Subject: [PATCH] Update Intelligence.lua - Added check for filter categories. --- Moose Development/Moose/Ops/Intelligence.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Moose Development/Moose/Ops/Intelligence.lua b/Moose Development/Moose/Ops/Intelligence.lua index fe92965cb..0f71a234e 100644 --- a/Moose Development/Moose/Ops/Intelligence.lua +++ b/Moose Development/Moose/Ops/Intelligence.lua @@ -159,7 +159,7 @@ INTEL.Ctype={ --- INTEL class version. -- @field #string version -INTEL.version="0.3.4" +INTEL.version="0.3.5" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ToDo list @@ -815,8 +815,8 @@ function INTEL:UpdateIntel() end end - -- Filter unit categories. - if #self.filterCategory>0 then + -- Filter unit categories. Added check that we have a UNIT and not a STATIC object because :GetUnitCategory() is only available for units. + if #self.filterCategory>0 and unit:IsInstanceOf("UNIT") then local unitcategory=unit:GetUnitCategory() local keepit=false for _,filtercategory in pairs(self.filterCategory) do @@ -1077,11 +1077,13 @@ function INTEL:GetDetectedUnits(Unit, DetectedUnits, RecceDetecting, DetectVisua RecceDetecting[name]=reccename self:T(string.format("Unit %s detect by %s", name, reccename)) else - local static=STATIC:FindByName(name, false) - if static then - --env.info("FF found static "..name) - DetectedUnits[name]=static - RecceDetecting[name]=reccename + if self.detectStatics then + local static=STATIC:FindByName(name, false) + if static then + --env.info("FF found static "..name) + DetectedUnits[name]=static + RecceDetecting[name]=reccename + end end end