getCategory behaviour

- Fixed several classes for new `getCategory` behaviour (should be backwards compatible to earlier DCS versions).
This commit is contained in:
Frank
2023-11-16 22:32:01 +01:00
parent 826ae86cb7
commit 5353be482e
8 changed files with 24 additions and 23 deletions

View File

@@ -1093,11 +1093,8 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
--if ZoneObject:isExist() then --FF: isExist always returns false for SCENERY objects since DCS 2.2 and still in DCS 2.5
if ZoneObject then
local ObjectCategory = ZoneObject:getCategory()
--local name=ZoneObject:getName()
--env.info(string.format("Zone object %s", tostring(name)))
--self:E(ZoneObject)
-- Get object category.
local ObjectCategory = Object.getCategory(ZoneObject)
if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
@@ -2801,7 +2798,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
if ZoneObject then
local ObjectCategory = ZoneObject:getCategory()
local ObjectCategory = Object.getCategory(ZoneObject)
if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then