game: port FindControlPointRoundToPlay

This commit is contained in:
SanyaSho 2022-08-10 22:21:05 +03:00
parent d30c3c4cc0
commit 040e86b971
2 changed files with 28 additions and 1 deletions

View File

@ -461,6 +461,29 @@ void CTeamControlPointMaster::RegisterRoundBeingPlayed( void )
}
}
#if defined( TF_MOD )
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTeamControlPointMaster::FindControlPointRoundToPlay( void )
{
for ( int i = 0 ; i < m_ControlPointRounds.Count() ; ++i )
{
CTeamControlPointRound *pRound = m_ControlPointRounds[i];
if ( pRound )
{
if ( pRound->IsPlayable() )
{
// we found one that's playable
return true;
}
}
}
return false;
}
#endif
//-----------------------------------------------------------------------------
// Purpose:
@ -1344,4 +1367,4 @@ void cc_PlayRound( const CCommand& args )
}
static ConCommand playround( "playround", cc_PlayRound, "Play the selected round\n\tArgument: {round name given by \"listrounds\" command}", FCVAR_CHEAT );
*/
*/

View File

@ -129,6 +129,10 @@ public:
void SetLastOwnershipChangeTime( float m_flTime ) { m_flLastOwnershipChangeTime = m_flTime; }
float GetLastOwnershipChangeTime( void ) { return m_flLastOwnershipChangeTime; }
#if defined( TF_MOD )
bool FindControlPointRoundToPlay( void ); // checks to see if there are any more rounds to play (but doesn't actually "get" one to play)
#endif
private:
void EXPORT CPMThink( void );