[TF] Add null pointer checks for recent casual doors fix.

This commit is contained in:
Bitl
2025-08-15 10:45:14 -07:00
committed by EricS-Valve
parent 7334729130
commit 1a20bc8363

View File

@@ -575,32 +575,38 @@ void CTFHudMatchStatus::FireGameEvent( IGameEvent * event )
const IMatchGroupDescription* pMatchDesc = GetMatchGroupDescription( TFGameRules()->GetCurrentMatchGroup() );
// FIX: Refresh versus doors so late-joiners do not see the wrong skin
int nSkin = 0;
int nSubModel = 0;
if (pMatchDesc->BGetRoundDoorParameters(nSkin, nSubModel))
if ( pMatchDesc )
{
// Is VS doors model not initialized yet?
if (m_pMatchStartModelPanel->m_hModel == NULL)
// FIX: Refresh versus doors so late-joiners do not see the wrong skin
int nSkin = 0;
int nSubModel = 0;
if ( pMatchDesc->BGetRoundDoorParameters( nSkin, nSubModel ) )
{
m_pMatchStartModelPanel->UpdateModel();
if ( m_pMatchStartModelPanel )
{
// Is VS doors model not initialized yet?
if ( m_pMatchStartModelPanel->m_hModel == NULL )
{
m_pMatchStartModelPanel->UpdateModel();
}
m_pMatchStartModelPanel->SetBodyGroup( "logos", nSubModel );
m_pMatchStartModelPanel->UpdateModel();
m_pMatchStartModelPanel->SetSkin( nSkin );
}
}
m_pMatchStartModelPanel->SetBodyGroup( "logos", nSubModel );
m_pMatchStartModelPanel->UpdateModel();
m_pMatchStartModelPanel->SetSkin( nSkin );
}
bool bForceDoors = false;
if ( bForceDoors || ( pMatchDesc && pMatchDesc->BUsesPostRoundDoors() ) )
{
if ( TFGameRules() && TFGameRules()->MapHasMatchSummaryStage() && ( bForceDoors || pMatchDesc->BUseMatchSummaryStage() ) )
bool bForceDoors = false;
if ( bForceDoors || ( pMatchDesc && pMatchDesc->BUsesPostRoundDoors() ) )
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "HudMatchStatus_ShowMatchWinDoors", false );
}
else
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "HudMatchStatus_ShowMatchWinDoors_NoOpen", false );
if ( TFGameRules() && TFGameRules()->MapHasMatchSummaryStage() && ( bForceDoors || pMatchDesc->BUseMatchSummaryStage() ) )
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "HudMatchStatus_ShowMatchWinDoors", false );
}
else
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "HudMatchStatus_ShowMatchWinDoors_NoOpen", false );
}
}
}
}