Fixing errors due to core changes in the model.

This commit is contained in:
FlightControl_Master 2018-03-22 05:01:14 +01:00
parent 7a4a3217df
commit 52d783a0b7
11 changed files with 30 additions and 26 deletions

View File

@ -2993,7 +2993,7 @@ do -- AI_A2A_DISPATCHER
local DetectedZone = DetectedItem.Zone local DetectedZone = DetectedItem.Zone
self:F( { "Target ID", DetectedItem.ItemID } ) self:F( { "Target ID", DetectedItem.ItemID } )
DetectedSet:Flush() DetectedSet:Flush( self )
local DetectedID = DetectedItem.ID local DetectedID = DetectedItem.ID
local DetectionIndex = DetectedItem.Index local DetectionIndex = DetectedItem.Index

View File

@ -189,9 +189,9 @@ end
function AI_BALANCER:onenterDestroying( SetGroup, From, Event, To, ClientName, AIGroup ) function AI_BALANCER:onenterDestroying( SetGroup, From, Event, To, ClientName, AIGroup )
AIGroup:Destroy() AIGroup:Destroy()
SetGroup:Flush() SetGroup:Flush( self )
SetGroup:Remove( ClientName ) SetGroup:Remove( ClientName )
SetGroup:Flush() SetGroup:Flush( self )
end end
--- @param #AI_BALANCER self --- @param #AI_BALANCER self

View File

@ -671,7 +671,7 @@ end
function AI_FORMATION:onafterFormationLine( FollowGroupSet, From , Event , To, XStart, XSpace, YStart, YSpace, ZStart, ZSpace ) --R2.1 function AI_FORMATION:onafterFormationLine( FollowGroupSet, From , Event , To, XStart, XSpace, YStart, YSpace, ZStart, ZSpace ) --R2.1
self:F( { FollowGroupSet, From , Event ,To, XStart, XSpace, YStart, YSpace, ZStart, ZSpace } ) self:F( { FollowGroupSet, From , Event ,To, XStart, XSpace, YStart, YSpace, ZStart, ZSpace } )
FollowGroupSet:Flush() FollowGroupSet:Flush( self )
local FollowSet = FollowGroupSet:GetSet() local FollowSet = FollowGroupSet:GetSet()

View File

@ -97,7 +97,7 @@ end
function PROCESS_PICKUP:OnHitTarget( Fsm, From, Event, To, Event ) function PROCESS_PICKUP:OnHitTarget( Fsm, From, Event, To, Event )
self.TargetSetUnit:Flush() self.TargetSetUnit:Flush( self )
if self.TargetSetUnit:FindUnit( Event.IniUnitName ) then if self.TargetSetUnit:FindUnit( Event.IniUnitName ) then
self.TargetSetUnit:RemoveUnitsByName( Event.IniUnitName ) self.TargetSetUnit:RemoveUnitsByName( Event.IniUnitName )

View File

@ -613,7 +613,7 @@ function SET_BASE:Flush( MasterObject )
for ObjectName, Object in pairs( self.Set ) do for ObjectName, Object in pairs( self.Set ) do
ObjectNames = ObjectNames .. ObjectName .. ", " ObjectNames = ObjectNames .. ObjectName .. ", "
end end
self:I( { MasterObject = MasterObject:GetClassNameAndID(), "Objects in Set:", ObjectNames } ) self:I( { MasterObject = MasterObject and MasterObject:GetClassNameAndID(), "Objects in Set:", ObjectNames } )
return ObjectNames return ObjectNames
end end

View File

@ -771,7 +771,7 @@ do -- DESIGNATE
--- @param Wrapper.Group#GROUP AttackGroup --- @param Wrapper.Group#GROUP AttackGroup
function( AttackGroup ) function( AttackGroup )
if AttackGroup:IsAlive() == true then if AttackGroup:IsAlive() == true then
local DetectionText = self.Detection:DetectedItemReportSummary( DesignateIndex, AttackGroup ):Text( ", " ) local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName ) self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName )
end end
end end
@ -854,7 +854,7 @@ do -- DESIGNATE
for DesignateIndex, Designating in pairs( self.Designating ) do for DesignateIndex, Designating in pairs( self.Designating ) do
local DetectedItem = DetectedItems[DesignateIndex] local DetectedItem = DetectedItems[DesignateIndex]
if DetectedItem then if DetectedItem then
local Report = self.Detection:DetectedItemReportSummary( DesignateIndex, AttackGroup ):Text( ", " ) local Report = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " )
DetectedReport:Add( string.rep( "-", 140 ) ) DetectedReport:Add( string.rep( "-", 140 ) )
DetectedReport:Add( " - " .. Report ) DetectedReport:Add( " - " .. Report )
if string.find( Designating, "L" ) then if string.find( Designating, "L" ) then
@ -942,8 +942,8 @@ do -- DESIGNATE
if DetectedItem then if DetectedItem then
local Coord = self.Detection:GetDetectedItemCoordinate( DesignateIndex ) local Coord = self.Detection:GetDetectedItemCoordinate( DetectedItem )
local ID = self.Detection:GetDetectedItemID( DesignateIndex ) local ID = self.Detection:GetDetectedItemID( DetectedItem )
local MenuText = ID --.. ", " .. Coord:ToStringA2G( AttackGroup ) local MenuText = ID --.. ", " .. Coord:ToStringA2G( AttackGroup )
MenuText = string.format( "(%3s) %s", Designating, MenuText ) MenuText = string.format( "(%3s) %s", Designating, MenuText )
@ -1101,14 +1101,15 @@ do -- DESIGNATE
function DESIGNATE:onafterLasing( From, Event, To, Index, Duration, LaserCodeRequested ) function DESIGNATE:onafterLasing( From, Event, To, Index, Duration, LaserCodeRequested )
local TargetSetUnit = self.Detection:GetDetectedSet( Index ) local DetectedItem = self.Detection:GetDetectedItemByIndex( Index )
local TargetSetUnit = self.Detection:GetDetectedSet( DetectedItem )
local MarkingCount = 0 local MarkingCount = 0
local MarkedTypes = {} local MarkedTypes = {}
local ReportTypes = REPORT:New() local ReportTypes = REPORT:New()
local ReportLaserCodes = REPORT:New() local ReportLaserCodes = REPORT:New()
TargetSetUnit:Flush() TargetSetUnit:Flush( self )
--self:F( { Recces = self.Recces } ) --self:F( { Recces = self.Recces } )
for TargetUnit, RecceData in pairs( self.Recces ) do for TargetUnit, RecceData in pairs( self.Recces ) do
@ -1156,7 +1157,7 @@ do -- DESIGNATE
if not Recce then if not Recce then
self:F( "Lasing..." ) self:F( "Lasing..." )
self.RecceSet:Flush() self.RecceSet:Flush( self)
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
for UnitID, UnitData in pairs( RecceGroup:GetUnits() or {} ) do for UnitID, UnitData in pairs( RecceGroup:GetUnits() or {} ) do
@ -1270,7 +1271,8 @@ do -- DESIGNATE
CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName ) CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName )
end end
local TargetSetUnit = self.Detection:GetDetectedSet( Index ) local DetectedItem = self.Detection:GetDetectedItemByIndex( Index )
local TargetSetUnit = self.Detection:GetDetectedSet( DetectedItem )
local Recces = self.Recces local Recces = self.Recces
@ -1294,7 +1296,8 @@ do -- DESIGNATE
-- @return #DESIGNATE -- @return #DESIGNATE
function DESIGNATE:onafterSmoke( From, Event, To, Index, Color ) function DESIGNATE:onafterSmoke( From, Event, To, Index, Color )
local TargetSetUnit = self.Detection:GetDetectedSet( Index ) local DetectedItem = self.Detection:GetDetectedItemByIndex( Index )
local TargetSetUnit = self.Detection:GetDetectedSet( DetectedItem )
local TargetSetUnitCount = TargetSetUnit:Count() local TargetSetUnitCount = TargetSetUnit:Count()
local MarkedCount = 0 local MarkedCount = 0
@ -1338,7 +1341,8 @@ do -- DESIGNATE
-- @return #DESIGNATE -- @return #DESIGNATE
function DESIGNATE:onafterIlluminate( From, Event, To, Index ) function DESIGNATE:onafterIlluminate( From, Event, To, Index )
local TargetSetUnit = self.Detection:GetDetectedSet( Index ) local DetectedItem = self.Detection:GetDetectedItemByIndex( Index )
local TargetSetUnit = self.Detection:GetDetectedSet( DetectedItem )
local TargetUnit = TargetSetUnit:GetFirst() local TargetUnit = TargetSetUnit:GetFirst()
if TargetUnit then if TargetUnit then

View File

@ -1729,7 +1729,7 @@ do -- DETECTION_BASE
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use. -- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
-- @return Core.Report#REPORT -- @return Core.Report#REPORT
function DETECTION_BASE:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings ) function DETECTION_BASE:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
self:F( Index ) self:F()
return nil return nil
end end
@ -2707,7 +2707,7 @@ do -- DETECTION_AREAS
DetectedZone.ZoneUNIT:SmokeRed() DetectedZone.ZoneUNIT:SmokeRed()
end end
--DetectedSet:Flush() --DetectedSet:Flush( self )
DetectedSet:ForEachUnit( DetectedSet:ForEachUnit(
--- @param Wrapper.Unit#UNIT DetectedUnit --- @param Wrapper.Unit#UNIT DetectedUnit

View File

@ -113,7 +113,7 @@ function PROTECT:AreProtectUnitsAlive()
local IsAlive = false local IsAlive = false
local UnitSet = self.ProtectUnitSet local UnitSet = self.ProtectUnitSet
UnitSet:Flush() UnitSet:Flush( self )
local UnitList = UnitSet:GetSet() local UnitList = UnitSet:GetSet()
for UnitID, ProtectUnit in pairs( UnitList ) do for UnitID, ProtectUnit in pairs( UnitList ) do
@ -134,7 +134,7 @@ function PROTECT:AreProtectStaticsAlive()
local IsAlive = false local IsAlive = false
local StaticSet = self.ProtectStaticSet local StaticSet = self.ProtectStaticSet
StaticSet:Flush() StaticSet:Flush( self )
local StaticList = StaticSet:GetSet() local StaticList = StaticSet:GetSet()
for UnitID, ProtectStatic in pairs( StaticList ) do for UnitID, ProtectStatic in pairs( StaticList ) do
@ -154,7 +154,7 @@ end
function PROTECT:IsCaptureUnitInZone() function PROTECT:IsCaptureUnitInZone()
local CaptureUnitSet = self.CaptureUnitSet local CaptureUnitSet = self.CaptureUnitSet
CaptureUnitSet:Flush() CaptureUnitSet:Flush( self )
local IsInZone = self.CaptureUnitSet:IsPartiallyInZone( self.ProtectZone ) local IsInZone = self.CaptureUnitSet:IsPartiallyInZone( self.ProtectZone )

View File

@ -323,7 +323,7 @@ function TASK:AbortGroup( PlayerGroup )
-- Now check if the task needs to go to hold... -- Now check if the task needs to go to hold...
-- It will go to hold, if there are no players in the mission... -- It will go to hold, if there are no players in the mission...
PlayerGroups:Flush() PlayerGroups:Flush( self )
local IsRemaining = false local IsRemaining = false
for GroupName, AssignedGroup in pairs( PlayerGroups:GetSet() or {} ) do for GroupName, AssignedGroup in pairs( PlayerGroups:GetSet() or {} ) do
if self:IsGroupAssigned( AssignedGroup ) == true then if self:IsGroupAssigned( AssignedGroup ) == true then
@ -374,7 +374,7 @@ function TASK:CrashGroup( PlayerGroup )
-- Now check if the task needs to go to hold... -- Now check if the task needs to go to hold...
-- It will go to hold, if there are no players in the mission... -- It will go to hold, if there are no players in the mission...
PlayerGroups:Flush() PlayerGroups:Flush( self )
local IsRemaining = false local IsRemaining = false
for GroupName, AssignedGroup in pairs( PlayerGroups:GetSet() or {} ) do for GroupName, AssignedGroup in pairs( PlayerGroups:GetSet() or {} ) do
if self:IsGroupAssigned( AssignedGroup ) == true then if self:IsGroupAssigned( AssignedGroup ) == true then

View File

@ -375,7 +375,7 @@ do -- TASK_A2A_DISPATCHER
end end
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
--DetectedSet:Flush() --DetectedSet:Flush( self )
--self:F( { DetectedSetCount = DetectedSet:Count() } ) --self:F( { DetectedSetCount = DetectedSet:Count() } )
if DetectedSet:Count() == 0 then if DetectedSet:Count() == 0 then
Remove = true Remove = true
@ -524,7 +524,7 @@ do -- TASK_A2A_DISPATCHER
local DetectedCount = DetectedSet:Count() local DetectedCount = DetectedSet:Count()
local DetectedZone = DetectedItem.Zone local DetectedZone = DetectedItem.Zone
--self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } ) --self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
--DetectedSet:Flush() --DetectedSet:Flush( self )
local DetectedID = DetectedItem.ID local DetectedID = DetectedItem.ID
local TaskIndex = DetectedItem.Index local TaskIndex = DetectedItem.Index

View File

@ -621,7 +621,7 @@ do -- TASK_A2G_DISPATCHER
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedZone = DetectedItem.Zone local DetectedZone = DetectedItem.Zone
--self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } ) --self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
--DetectedSet:Flush() --DetectedSet:Flush( self )
local DetectedItemID = DetectedItem.ID local DetectedItemID = DetectedItem.ID
local TaskIndex = DetectedItem.ID local TaskIndex = DetectedItem.ID