Moose.lua with the changes

This commit is contained in:
FlightControl 2017-03-05 10:14:53 +01:00
parent 538e040fdf
commit 3244f46e88
2 changed files with 46 additions and 24 deletions

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170305_0950' ) env.info( 'Moose Generation Timestamp: 20170305_1014' )
local base = _G local base = _G
Include = {} Include = {}
@ -7766,9 +7766,16 @@ function DATABASE:_EventOnDeadOrCrash( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniDCSUnit then if Event.IniDCSUnit then
if self.UNITS[Event.IniDCSUnitName] then if Event.IniObjectCategory == 3 then
self:DeleteUnit( Event.IniDCSUnitName ) if self.STATICS[Event.IniDCSUnitName] then
-- add logic to correctly remove a group once all units are destroyed... self:DeleteStatic( Event.IniDCSUnitName )
end
else
if Event.IniObjectCategory == 1 then
if self.UNITS[Event.IniDCSUnitName] then
self:DeleteUnit( Event.IniDCSUnitName )
end
end
end end
end end
end end
@ -7781,11 +7788,13 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniUnit then if Event.IniUnit then
self:AddUnit( Event.IniDCSUnitName ) if Event.IniObjectCategory == 1 then
self:AddGroup( Event.IniDCSGroupName ) self:AddUnit( Event.IniDCSUnitName )
local PlayerName = Event.IniUnit:GetPlayerName() self:AddGroup( Event.IniDCSGroupName )
if not self.PLAYERS[PlayerName] then local PlayerName = Event.IniUnit:GetPlayerName()
self:AddPlayer( Event.IniUnitName, PlayerName ) if not self.PLAYERS[PlayerName] then
self:AddPlayer( Event.IniUnitName, PlayerName )
end
end end
end end
end end
@ -7798,9 +7807,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

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170305_0950' ) env.info( 'Moose Generation Timestamp: 20170305_1014' )
local base = _G local base = _G
Include = {} Include = {}
@ -7766,9 +7766,16 @@ function DATABASE:_EventOnDeadOrCrash( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniDCSUnit then if Event.IniDCSUnit then
if self.UNITS[Event.IniDCSUnitName] then if Event.IniObjectCategory == 3 then
self:DeleteUnit( Event.IniDCSUnitName ) if self.STATICS[Event.IniDCSUnitName] then
-- add logic to correctly remove a group once all units are destroyed... self:DeleteStatic( Event.IniDCSUnitName )
end
else
if Event.IniObjectCategory == 1 then
if self.UNITS[Event.IniDCSUnitName] then
self:DeleteUnit( Event.IniDCSUnitName )
end
end
end end
end end
end end
@ -7781,11 +7788,13 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
self:F2( { Event } ) self:F2( { Event } )
if Event.IniUnit then if Event.IniUnit then
self:AddUnit( Event.IniDCSUnitName ) if Event.IniObjectCategory == 1 then
self:AddGroup( Event.IniDCSGroupName ) self:AddUnit( Event.IniDCSUnitName )
local PlayerName = Event.IniUnit:GetPlayerName() self:AddGroup( Event.IniDCSGroupName )
if not self.PLAYERS[PlayerName] then local PlayerName = Event.IniUnit:GetPlayerName()
self:AddPlayer( Event.IniUnitName, PlayerName ) if not self.PLAYERS[PlayerName] then
self:AddPlayer( Event.IniUnitName, PlayerName )
end
end end
end end
end end
@ -7798,9 +7807,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