mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Updates to make the tasking work correctly.
This commit is contained in:
@@ -1524,18 +1524,14 @@ do -- DETECTION_BASE
|
||||
local DetectedItem = {}
|
||||
self.DetectedItemCount = self.DetectedItemCount + 1
|
||||
self.DetectedItemMax = self.DetectedItemMax + 1
|
||||
|
||||
if DetectedItemKey then
|
||||
self.DetectedItems[DetectedItemKey] = DetectedItem
|
||||
else
|
||||
self.DetectedItems[self.DetectedItemMax] = DetectedItem
|
||||
end
|
||||
|
||||
self.DetectedItemsByIndex[self.DetectedItemMax] = DetectedItem
|
||||
|
||||
|
||||
self.DetectedItems[DetectedItemKey] = DetectedItem
|
||||
|
||||
local DetectedItemIndex = DetectedItemKey or self.DetectedItemMax
|
||||
self.DetectedItemsByIndex[DetectedItemIndex] = DetectedItem
|
||||
DetectedItem.Index = DetectedItemIndex
|
||||
|
||||
DetectedItem.Set = Set or SET_UNIT:New():FilterDeads():FilterCrashes()
|
||||
DetectedItem.Index = DetectedItemKey or self.DetectedItemMax
|
||||
DetectedItem.ItemID = ItemPrefix .. "." .. self.DetectedItemMax
|
||||
DetectedItem.ID = self.DetectedItemMax
|
||||
DetectedItem.Removed = false
|
||||
|
||||
@@ -261,8 +261,8 @@ do -- DETECTION_ZONES
|
||||
|
||||
local DetectedUnits = SET_UNIT:New()
|
||||
|
||||
-- First go through all detected sets, and check if there are new detected units, match all existing detected units and identify undetected units.
|
||||
-- Regroup when needed, split groups when needed.
|
||||
-- First go through all zones, and check if there are new Zones.
|
||||
-- New Zones become a new DetectedItem.
|
||||
for ZoneName, DetectionZone in pairs( self.DetectionSetZone:GetSet() ) do
|
||||
|
||||
local DetectedItem = self:GetDetectedItemByKey( ZoneName )
|
||||
@@ -276,6 +276,8 @@ do -- DETECTION_ZONES
|
||||
-- Scan the zone
|
||||
DetectionZone:Scan( { Object.Category.UNIT }, { Unit.Category.GROUND_UNIT } )
|
||||
|
||||
-- For all the units in the zone,
|
||||
-- check if they are of the same coalition to be included.
|
||||
local ZoneUnits = DetectionZone:GetScannedUnits()
|
||||
for DCSUnitID, DCSUnit in pairs( ZoneUnits ) do
|
||||
local UnitName = DCSUnit:getName()
|
||||
@@ -289,11 +291,8 @@ do -- DETECTION_ZONES
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Now all the tests should have been build, now make some smoke and flares...
|
||||
-- We also report here the friendlies within the detected areas.
|
||||
|
||||
Reference in New Issue
Block a user