Block team changes during demo playback
Prevent spectators from joining a playing team during demo playback, which would disrupt the playback state. Prints a message to the client instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
300e7c431a
commit
76538c3216
1 changed files with 6 additions and 0 deletions
|
|
@ -661,6 +661,12 @@ void Cmd_Team_f( gentity_t *ent ) {
|
|||
int oldTeam;
|
||||
char s[MAX_TOKEN_CHARS];
|
||||
|
||||
// demo playback: spectators only
|
||||
if ( trap_Cvar_VariableIntegerValue( "sv_demoplaying" ) ) {
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Team changes disabled during demo playback.\n\"" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( trap_Argc() != 2 ) {
|
||||
oldTeam = ent->client->sess.sessionTeam;
|
||||
switch ( oldTeam ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue