diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 58f12c4f1..bd56a7454 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -437,44 +437,44 @@ end --- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied). -- @param #SET_BASE self -- @param Core.Event#EVENTDATA Event -function SET_BASE:_EventOnPlayerEnterUnit( Event ) - self:F3( { Event } ) - - if Event.IniDCSUnit then - local ObjectName, Object = self:AddInDatabase( Event ) - self:T3( ObjectName, Object ) - if self:IsIncludeObject( Object ) then - self:Add( ObjectName, Object ) - --self:_EventOnPlayerEnterUnit( Event ) - end - end -end +--function SET_BASE:_EventOnPlayerEnterUnit( Event ) +-- self:F3( { Event } ) +-- +-- if Event.IniDCSUnit then +-- local ObjectName, Object = self:AddInDatabase( Event ) +-- self:T3( ObjectName, Object ) +-- if self:IsIncludeObject( Object ) then +-- self:Add( ObjectName, Object ) +-- --self:_EventOnPlayerEnterUnit( Event ) +-- end +-- end +--end --- Handles the OnPlayerLeaveUnit event to clean the active players table. -- @param #SET_BASE self -- @param Core.Event#EVENTDATA Event -function SET_BASE:_EventOnPlayerLeaveUnit( Event ) - self:F3( { Event } ) - - local ObjectName = Event.IniDCSUnit - if Event.IniDCSUnit then - if Event.IniDCSGroup then - local GroupUnits = Event.IniDCSGroup:getUnits() - local PlayerCount = 0 - for _, DCSUnit in pairs( GroupUnits ) do - if DCSUnit ~= Event.IniDCSUnit then - if DCSUnit:getPlayerName() ~= nil then - PlayerCount = PlayerCount + 1 - end - end - end - self:E(PlayerCount) - if PlayerCount == 0 then - self:Remove( Event.IniDCSGroupName ) - end - end - end -end +--function SET_BASE:_EventOnPlayerLeaveUnit( Event ) +-- self:F3( { Event } ) +-- +-- local ObjectName = Event.IniDCSUnit +-- if Event.IniDCSUnit then +-- if Event.IniDCSGroup then +-- local GroupUnits = Event.IniDCSGroup:getUnits() +-- local PlayerCount = 0 +-- for _, DCSUnit in pairs( GroupUnits ) do +-- if DCSUnit ~= Event.IniDCSUnit then +-- if DCSUnit:getPlayerName() ~= nil then +-- PlayerCount = PlayerCount + 1 +-- end +-- end +-- end +-- self:E(PlayerCount) +-- if PlayerCount == 0 then +-- self:Remove( Event.IniDCSGroupName ) +-- end +-- end +-- end +--end -- Iterators diff --git a/Moose Development/Moose/Functional/ATC_Ground.lua b/Moose Development/Moose/Functional/ATC_Ground.lua index a0a6a016c..1660cefa1 100644 --- a/Moose Development/Moose/Functional/ATC_Ground.lua +++ b/Moose Development/Moose/Functional/ATC_Ground.lua @@ -124,28 +124,24 @@ end --- @param #ATC_GROUND self function ATC_GROUND:_AirbaseMonitor() - self:E( "In Scheduler") + self.SetClient:ForEachClient( + --- @param Wrapper.Client#CLIENT Client + function( Client ) - for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do + if Client:IsAlive() then - if AirbaseMeta.Monitor == true then + local IsOnGround = Client:InAir() == false - self:E( AirbaseID, AirbaseMeta.MaximumSpeed ) + for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do + self:E( AirbaseID, AirbaseMeta.MaximumSpeed ) + + if AirbaseMeta.Monitor == true and Client:IsInZone( AirbaseMeta.ZoneBoundary ) then - self.SetClient:ForEachClientInZone( AirbaseMeta.ZoneBoundary, - - --- @param Wrapper.Client#CLIENT Client - function( Client ) - - self:E( Client.UnitName ) - if Client and Client:IsAlive() then local NotInRunwayZone = true for ZoneRunwayID, ZoneRunway in pairs( AirbaseMeta.ZoneRunways ) do NotInRunwayZone = ( Client:IsNotInZone( ZoneRunway ) == true ) and NotInRunwayZone or false end - local IsOnGround = Client:InAir() == false - if NotInRunwayZone then if IsOnGround then @@ -245,13 +241,13 @@ function ATC_GROUND:_AirbaseMonitor() Client:SetState( self, "Taxi", false ) end end - else - Client:SetState( self, "Taxi", false ) end end - ) + else + Client:SetState( self, "Taxi", false ) + end end - end + ) return true end diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index e0b4ec30e..5e103cb10 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -671,6 +671,7 @@
Handles the OnDead or OnCrash event for alive units set.
-Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
-Handles the OnPlayerLeaveUnit event to clean the active players table.
Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
- -Core.Event#EVENTDATA Event :
Handles the OnPlayerLeaveUnit event to clean the active players table.
- -Core.Event#EVENTDATA Event :
Overwrite unit names by default with group name.
-By default, no InitLimit
-Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
+When the first Spawn executes, all the Groups need to be made visible before start.
self.SmokeColor = nil
-