mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Working version, fiew!
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user