This commit is contained in:
Applevangelist 2025-07-29 17:38:11 +02:00
parent 413fa31534
commit fc37149e9d
2 changed files with 13 additions and 10 deletions

View File

@ -1280,7 +1280,8 @@ end
function ZONE_RADIUS:GetScannedSetGroup() function ZONE_RADIUS:GetScannedSetGroup()
self.ScanSetGroup=self.ScanSetGroup or SET_GROUP:New() --Core.Set#SET_GROUP self.ScanSetGroup=self.ScanSetGroup or SET_GROUP:New() --Core.Set#SET_GROUP
self.ScanSetGroup:Clear(false)
self.ScanSetGroup.Set={} self.ScanSetGroup.Set={}
if self.ScanData then if self.ScanData then

View File

@ -105,7 +105,7 @@
TIRESIAS = { TIRESIAS = {
ClassName = "TIRESIAS", ClassName = "TIRESIAS",
debug = true, debug = true,
version = " 0.0.7-OPT" , version = " 0.0.7a-OPT" ,
Interval = 20, Interval = 20,
GroundSet = nil, GroundSet = nil,
VehicleSet = nil, VehicleSet = nil,
@ -419,8 +419,8 @@ function TIRESIAS:_SwitchOnGroups(group, radius)
-- Use cached zones to reduce object creation -- Use cached zones to reduce object creation
local group_name = group:GetName() local group_name = group:GetName()
local cache_key = group_name .. " _" .. radius local cache_key = group_name .. " _" .. radius
local zone = self._cached_zones[cache_key] local zone = self._cached_zones[cache_key] -- Core.Zone#ZONE_RADIUS
local ground = self._cached_groupsets[cache_key] --local ground = self._cached_groupsets[cache_key] -- Core.Set#SET_GROUP
if not zone then if not zone then
zone = ZONE_GROUP:New(" Zone-" .. group_name, group, UTILS.NMToMeters(radius)) zone = ZONE_GROUP:New(" Zone-" .. group_name, group, UTILS.NMToMeters(radius))
@ -430,12 +430,14 @@ function TIRESIAS:_SwitchOnGroups(group, radius)
zone:UpdateFromGroup(group) zone:UpdateFromGroup(group)
end end
if not ground then --if not ground then
ground = SET_GROUP:New():FilterCategoryGround():FilterZones({zone}):FilterOnce() --ground = SET_GROUP:New():FilterCategoryGround():FilterZones({zone}):FilterOnce()
self._cached_groupsets[cache_key] = ground --self._cached_groupsets[cache_key] = ground
else --else
ground:FilterZones({zone},true):FilterOnce() --ground:FilterZones({zone},true):FilterOnce()
end zone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
local ground = zone:GetScannedSetGroup()
--end
local count = ground:CountAlive() local count = ground:CountAlive()