From fcc69b27aa3e2a18042d37499714029144a9ee99 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Tue, 26 Feb 2002 21:59:10 +0000 Subject: [PATCH] Fixed death on switching teams while dead --- reaction/game/g_client.c | 14 ++++++++++++-- reaction/game/g_cmds.c | 9 +++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index 86438970..69d6b6ca 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.39 2002/02/26 21:59:10 jbravo +// Fixed death on switching teams while dead +// // Revision 1.38 2002/02/26 02:58:47 jbravo // Fixing the spectator_free mode not being predicted in the client. // @@ -1085,6 +1088,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) { // JBravo: Antistick client->ps.stats[STAT_RQ3] &= ~RQ3_PLAYERSOLID; +// JBravo: Clear zcam flag for cgame client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM; // read or initialize the session data @@ -1118,6 +1122,12 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) { // count current clients and rank for scoreboard CalculateRanks(); +// JBravo: clients in TP begin as spectators + if (g_gametype.integer == GT_TEAMPLAY) { + client->sess.sessionTeam = TEAM_SPECTATOR; + client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR; + } + // for statistics // client->areabits = areabits; // if ( !client->areabits ) @@ -1194,11 +1204,11 @@ void ClientBegin( int clientNum ) { client->sess.sessionTeam = TEAM_SPECTATOR; client->sess.spectatorState = SPECTATOR_FREE; #ifdef __ZCAM__ - client->camera->mode = CAMERA_MODE_FLIC; + client->camera->mode = CAMERA_MODE_SWING; #endif } - if ( client->sess.sessionTeam != TEAM_SPECTATOR ) { + if (client->sess.sessionTeam != TEAM_SPECTATOR && g_gametype.integer != GT_TEAMPLAY) { client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //set to short range client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index b6b258d5..f6c4a848 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.59 2002/02/26 21:59:10 jbravo +// Fixed death on switching teams while dead +// // Revision 1.58 2002/02/26 04:59:10 jbravo // Fixed teamswitching and team broadcasting // @@ -731,14 +734,12 @@ void SetTeam( gentity_t *ent, char *s ) client->pers.teamState.state = TEAM_BEGIN; // JBravo: if player is changing from FREE or SPECT. there is no need for violence. - //Slicer: If he's dead no need for violence too - if ((oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE) && - ent->client->ps.pm_type == PM_NORMAL) { + if (client->sess.sessionTeam != TEAM_SPECTATOR && client->sess.sessionTeam != TEAM_FREE && + client->ps.pm_type == PM_NORMAL) { // Kill him (makes sure he loses flags, etc) ent->flags &= ~FL_GODMODE; ent->client->ps.stats[STAT_HEALTH] = ent->health = 0; player_die (ent, ent, ent, 100000, MOD_SUICIDE); - } // JBravo: lets set the correct var here.