[ioquake3] 85/136: Fix joining team when starting local team play server

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 4506ebd5d7690b8677aaa598c173dcc71f013426
Author: Zack Middleton <zack at cloemail.com>
Date:   Fri Jun 2 21:07:25 2017 -0500

    Fix joining team when starting local team play server
    
    AKA fix joining team in Team Arena single player. Though it also
    affects starting Q3 skirmish in team dm or ctf modes.
---
 code/game/g_cmds.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c
index 29a1ce1..df74ef0 100644
--- a/code/game/g_cmds.c
+++ b/code/game/g_cmds.c
@@ -592,8 +592,8 @@ void SetTeam( gentity_t *ent, char *s ) {
 	// execute the team change
 	//
 
-	// if the player was dead leave the body
-	if ( client->ps.stats[STAT_HEALTH] <= 0 ) {
+	// if the player was dead leave the body, but only if they're actually in game
+	if ( client->ps.stats[STAT_HEALTH] <= 0 && client->pers.connected == CON_CONNECTED ) {
 		CopyToBodyQue(ent);
 	}
 
@@ -633,6 +633,11 @@ void SetTeam( gentity_t *ent, char *s ) {
 	// get and distribute relevent paramters
 	ClientUserinfoChanged( clientNum );
 
+	// client hasn't spawned yet, they sent an early team command
+	if ( client->pers.connected != CON_CONNECTED ) {
+		return;
+	}
+
 	ClientBegin( clientNum );
 }
 
@@ -1659,6 +1664,14 @@ void ClientCommand( int clientNum ) {
 
 	ent = g_entities + clientNum;
 	if (!ent->client || ent->client->pers.connected != CON_CONNECTED) {
+		if (ent->client && ent->client->pers.localClient) {
+			// Handle early team command sent by UI when starting a local
+			// team play game.
+			trap_Argv( 0, cmd, sizeof( cmd ) );
+			if (Q_stricmp (cmd, "team") == 0) {
+				Cmd_Team_f (ent);
+			}
+		}
 		return;		// not fully in game yet
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list