From 93b03c0ea6e9a4733df3637fccdd778173262175 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Mon, 25 Feb 2002 19:41:53 +0000 Subject: [PATCH] Fixed the use ESC and join menu to join teams when dead players are spectating in TP mode. Tuned the autorespawn system a bit. Now dead ppl. are dead for a very small time before they are made into spectators. --- reaction/cgame/cg_draw.c | 9 ++++++++- reaction/game/bg_public.h | 7 +++++++ reaction/game/g_active.c | 18 +++++++++++------ reaction/game/g_cmds.c | 7 +++++++ reaction/game/g_combat.c | 41 +++++++++++++++++++++++--------------- reaction/game/g_session.c | 9 +++++++++ reaction/game/g_teamplay.c | 8 ++++++++ 7 files changed, 76 insertions(+), 23 deletions(-) diff --git a/reaction/cgame/cg_draw.c b/reaction/cgame/cg_draw.c index c3d2e589..e6a75fac 100644 --- a/reaction/cgame/cg_draw.c +++ b/reaction/cgame/cg_draw.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.21 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.20 2002/02/23 18:07:46 slicer // Changed Sniper code and Cam code // @@ -2752,7 +2758,8 @@ static void CG_Draw2D( void ) { */ //Slicer: Adding HUD for follow spectating if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR && !(cg.snap->ps.pm_flags & PMF_FOLLOW) ) { - CG_DrawSpectator(); + if (cg.snap->ps.persistant[PERS_SAVEDTEAM] != TEAM_RED && cg.snap->ps.persistant[PERS_SAVEDTEAM] != TEAM_BLUE) + CG_DrawSpectator(); CG_DrawCrosshair(); CG_DrawCrosshairNames(); } else { diff --git a/reaction/game/bg_public.h b/reaction/game/bg_public.h index e1e006cc..f759c1cd 100644 --- a/reaction/game/bg_public.h +++ b/reaction/game/bg_public.h @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.47 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.46 2002/02/11 00:30:23 niceass // LCA fix // @@ -569,6 +575,7 @@ typedef enum { PERS_GAUNTLET_FRAG_COUNT, // kills with the guantlet PERS_CAPTURES // captures */ + PERS_SAVEDTEAM, // JBravo: for TP PERS_WEAPONMODES // Blaze: Holds the different weapond modes for the different guns see below for the defines to use } persEnum_t; //RQ3 Weapon modes - If the bit is set, then the weapon is in the more restrictive mode, as in if it's set to 1 it's semi, 3rnd burst, etc diff --git a/reaction/game/g_active.c b/reaction/game/g_active.c index 0c14f74d..edd98c69 100644 --- a/reaction/game/g_active.c +++ b/reaction/game/g_active.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.55 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.54 2002/02/23 16:55:09 jbravo // Added debugging to help find what was going with can't find item for weapon // error that crash the server. @@ -1473,13 +1479,13 @@ void ClientThink_real( gentity_t *ent ) { if (level.time > client->respawnTime) { // forcerespawn is to prevent users from waiting out powerups if (g_forcerespawn.integer > 0 && - (level.time - client->respawnTime ) > g_forcerespawn.integer * 1000) { - if (g_gametype.integer == GT_TEAMPLAY) { - MakeSpectator(ent); - } else { + (level.time - client->respawnTime ) > g_forcerespawn.integer * 1000 && + g_gametype.integer != GT_TEAMPLAY) { respawn( ent ); - } - return; + return; + } + if (g_gametype.integer == GT_TEAMPLAY && level.time > client->respawnTime) { + MakeSpectator(ent); } // pressing attack or use is the normal respawn method diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index a12e86fd..72ae5c25 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.55 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.54 2002/02/25 17:54:57 jbravo // Added [DEAD] tags infront of players names where appropriate and made // the server log conversation like AQ does. @@ -728,6 +734,7 @@ void SetTeam( gentity_t *ent, char *s ) client->sess.sessionTeam = team; } else if ( !client->sess.teamSpawn ) { client->sess.savedTeam = team; + client->ps.persistant[PERS_SAVEDTEAM] = team; } else { client->sess.sessionTeam = team; } diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 0804c640..31a1d289 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.45 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.44 2002/02/24 18:49:21 jbravo // Make it OK to frag teammates after rounds are over (no -1) // @@ -910,21 +916,24 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int } #endif - Cmd_Score_f(self); // show scores - // send updated scores to any clients that are following this one, - // or they would get stale scoreboards - for (i = 0 ; i < level.maxclients ; i++) { - gclient_t *client; - - client = &level.clients[i]; - if (client->pers.connected != CON_CONNECTED) { - continue; - } - if (client->sess.sessionTeam != TEAM_SPECTATOR) { - continue; - } - if (client->sess.spectatorClient == self->s.number) { - Cmd_Score_f(g_entities + i); +// JBravo: no need for automatic scoreboard on deaths. + if (g_gametype.integer != GT_TEAMPLAY) { + Cmd_Score_f(self); // show scores + // send updated scores to any clients that are following this one, + // or they would get stale scoreboards + for (i = 0 ; i < level.maxclients ; i++) { + gclient_t *client; + + client = &level.clients[i]; + if (client->pers.connected != CON_CONNECTED) { + continue; + } + if (client->sess.sessionTeam != TEAM_SPECTATOR) { + continue; + } + if (client->sess.spectatorClient == self->s.number) { + Cmd_Score_f(g_entities + i); + } } } @@ -951,7 +960,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int // g_forcerespawn may force spawning at some later time // JBravo: we dont want automatic respawning of players in teamplay if (g_gametype.integer == GT_TEAMPLAY) { - self->client->respawnTime = level.time + 400; + self->client->respawnTime = level.time + 1000; } else { self->client->respawnTime = level.time + 1700; } diff --git a/reaction/game/g_session.c b/reaction/game/g_session.c index a295baa3..1f7121fc 100644 --- a/reaction/game/g_session.c +++ b/reaction/game/g_session.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.9 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.8 2002/02/09 00:10:12 jbravo // Fixed spectator follow and free and updated zcam to 1.04 and added the // missing zcam files. @@ -126,6 +132,9 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) { sess->savedTeam = TEAM_SPECTATOR; +// JBravo: adding PERS_SAVEDTEAM + client->ps.persistant[PERS_SAVEDTEAM] = TEAM_SPECTATOR; + // initial team determination if ( g_gametype.integer >= GT_TEAM ) { if ( g_teamAutoJoin.integer ) { diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index 34f5e377..a47f1455 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,12 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.20 2002/02/25 19:41:53 jbravo +// Fixed the use ESC and join menu to join teams when dead players are +// spectating in TP mode. +// Tuned the autorespawn system a bit. Now dead ppl. are dead for a very +// small time before they are made into spectators. +// // Revision 1.19 2002/02/24 18:12:19 jbravo // Added a cvar to control sniper behavior g_RQ3_sniperup. Def 0. if set yo 1 // it makes players spawn with the sniper up. @@ -250,6 +256,7 @@ void MakeAllLivePlayersObservers() if (!player->inuse || player->client->ps.pm_type != PM_NORMAL) continue; level.clients[i].sess.savedTeam = level.clients[i].sess.sessionTeam; + level.clients[i].ps.persistant[PERS_SAVEDTEAM] = level.clients[i].sess.sessionTeam; level.clients[i].sess.sessionTeam = TEAM_SPECTATOR; level.clients[i].sess.spectatorState = SPECTATOR_FREE; } @@ -700,6 +707,7 @@ void MakeSpectator( gentity_t *ent ) client->weaponCount[ent->client->ps.weapon] = 0; client->ps.stats[STAT_WEAPONS] = 0; client->sess.savedTeam = client->sess.sessionTeam; + client->ps.persistant[PERS_SAVEDTEAM] = client->sess.sessionTeam; client->sess.sessionTeam = TEAM_SPECTATOR; client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR; ClientSpawn(ent);