diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index aaa1f8f..cd84ad1 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -633,6 +633,11 @@ void SetTeam( gentity_t *ent, char *s ) { // get and distribute relevent paramters ClientUserinfoChanged( clientNum ); + // client sent an early team command, they haven't spawned yet + if ( client->pers.connected != CON_CONNECTED ) { + return; + } + ClientBegin( clientNum ); } @@ -1644,13 +1649,21 @@ void ClientCommand( int clientNum ) { char cmd[MAX_TOKEN_CHARS]; ent = g_entities + clientNum; - if (!ent->client || ent->client->pers.connected != CON_CONNECTED) { + if (!ent->client) { return; // not fully in game yet } trap_Argv( 0, cmd, sizeof( cmd ) ); + if (ent->client->pers.connected != CON_CONNECTED) { + // allow team to be set by UI when starting a local game + if (ent->client->pers.localClient && !level.intermissiontime && Q_stricmp (cmd, "team") == 0) { + Cmd_Team_f (ent); + } + return; + } + if (Q_stricmp (cmd, "say") == 0) { Cmd_Say_f (ent, SAY_ALL, qfalse); return;