Updated Database

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

View File

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