Check for valid team indexes

► Ensure players use a correct team index pointing to an existing team.
This commit is contained in:
speedvoltage 2025-03-11 22:14:01 +01:00
parent d22ad48b37
commit 01c376d3c2

View file

@ -1012,7 +1012,7 @@ bool CHL2MP_Player::HandleCommand_JoinTeam( int team )
{
if ( !GetGlobalTeam( team ) || team == 0 )
{
Warning( "HandleCommand_JoinTeam( %d ) - invalid team index.\n", team );
ClientPrint( this, HUD_PRINTCONSOLE, "Please enter a valid team index\n" );
return false;
}
@ -1064,11 +1064,6 @@ bool CHL2MP_Player::ClientCommand( const CCommand &args )
}
else if ( FStrEq( args[0], "jointeam" ) )
{
if ( args.ArgC() < 2 )
{
Warning( "Player sent bad jointeam syntax\n" );
}
if ( ShouldRunRateLimitedCommand( args ) )
{
int iTeam = atoi( args[1] );