Updated Database

This commit is contained in:
FlightControl 2017-03-05 10:05:12 +01:00
parent 158e41e04e
commit 538e040fdf

View File

@ -584,19 +584,15 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniUnit then if Event.IniUnit then
if Event.IniObjectCategory == 3 then
self:AddStatic( Event.IniDCSUnitName )
else
if Event.IniObjectCategory == 1 then if Event.IniObjectCategory == 1 then
self:AddUnit( Event.IniDCSUnitName ) self:AddUnit( Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroupName ) self:AddGroup( Event.IniDCSGroupName )
end
end
local PlayerName = Event.IniUnit:GetPlayerName() local PlayerName = Event.IniUnit:GetPlayerName()
if not self.PLAYERS[PlayerName] then if not self.PLAYERS[PlayerName] then
self:AddPlayer( Event.IniUnitName, PlayerName ) self:AddPlayer( Event.IniUnitName, PlayerName )
end end
end end
end
end end
@ -607,11 +603,13 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniUnit then if Event.IniUnit then
if Event.IniObjectCategory == 1 then
local PlayerName = Event.IniUnit:GetPlayerName() local PlayerName = Event.IniUnit:GetPlayerName()
if self.PLAYERS[PlayerName] then if self.PLAYERS[PlayerName] then
self:DeletePlayer( PlayerName ) self:DeletePlayer( PlayerName )
end end
end end
end
end end
--- Iterators --- Iterators