Solving the SCORING menu not anymore accessible due to S_EVENT_PLAYER_ENTER_UNIT bug in DCS (not fired anymore in MP when a player joins a slot).

This commit is contained in:
FlightControl_Master 2017-12-12 16:08:23 +01:00
parent 09d02e18cf
commit 95112e8818
2 changed files with 22 additions and 6 deletions

View File

@ -315,8 +315,8 @@ function SET_BASE:_FilterStart()
self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash ) self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash )
-- Follow alive players and clients -- Follow alive players and clients
self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit ) --self:HandleEvent( EVENTS.PlayerEnterUnit, self._EventOnPlayerEnterUnit )
self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit ) --self:HandleEvent( EVENTS.PlayerLeaveUnit, self._EventOnPlayerLeaveUnit )
return self return self

View File

@ -282,7 +282,7 @@ function SCORING:New( GameName )
self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash ) self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash )
self:HandleEvent( EVENTS.Hit, self._EventOnHit ) self:HandleEvent( EVENTS.Hit, self._EventOnHit )
self:HandleEvent( EVENTS.Birth ) self:HandleEvent( EVENTS.Birth )
self:HandleEvent( EVENTS.PlayerEnterUnit ) --self:HandleEvent( EVENTS.PlayerEnterUnit )
self:HandleEvent( EVENTS.PlayerLeaveUnit ) self:HandleEvent( EVENTS.PlayerLeaveUnit )
-- During mission startup, especially for single player, -- During mission startup, especially for single player,
@ -842,11 +842,27 @@ end
--- Handles the OnPlayerEnterUnit event for the scoring. --- Handles the OnPlayerEnterUnit event for the scoring.
-- @param #SCORING self -- @param #SCORING self
-- @param Core.Event#EVENTDATA Event -- @param Core.Event#EVENTDATA Event
function SCORING:OnEventPlayerEnterUnit( Event ) --function SCORING:OnEventPlayerEnterUnit( Event )
-- if Event.IniUnit then
-- self:_AddPlayerFromUnit( Event.IniUnit )
-- self:SetScoringMenu( Event.IniGroup )
-- end
--end
--- Handles the OnBirth event for the scoring.
-- @param #SCORING self
-- @param Core.Event#EVENTDATA Event
function SCORING:OnEventBirth( Event )
if Event.IniUnit then if Event.IniUnit then
if Event.IniObjectCategory == 1 then
local PlayerName = Event.IniUnit:GetPlayerName()
if PlayerName ~= "" then
self:_AddPlayerFromUnit( Event.IniUnit ) self:_AddPlayerFromUnit( Event.IniUnit )
self:SetScoringMenu( Event.IniGroup ) self:SetScoringMenu( Event.IniGroup )
end end
end
end
end end
--- Handles the OnPlayerLeaveUnit event for the scoring. --- Handles the OnPlayerLeaveUnit event for the scoring.