shared: Do not leak KeyValues in show round info panel when no round state

This commit is contained in:
Dmitry Tsarevich 2025-02-27 19:07:57 +03:00
parent fd904eaebd
commit 65c9f625c5
No known key found for this signature in database
GPG key ID: 43F9C46DD0E9FDB0

View file

@ -13905,13 +13905,13 @@ bool CTFGameRules::IsFirstBloodAllowed( void )
//-----------------------------------------------------------------------------
void CTFGameRules::ShowRoundInfoPanel( CTFPlayer *pPlayer /* = NULL */ )
{
KeyValues *data = new KeyValues( "data" );
if ( m_iCurrentRoundState < 0 )
{
// Haven't set up the round state yet
return;
}
KeyValues *data = new KeyValues( "data" );
// if prev and cur are equal, we are starting from a fresh round
if ( m_iPrevRoundState >= 0 && pPlayer == NULL ) // we have data about a previous state