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.
This commit is contained in:
Richard Allen 2002-02-25 19:41:53 +00:00
parent 4846491ea6
commit 93b03c0ea6
7 changed files with 76 additions and 23 deletions

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.20 2002/02/23 18:07:46 slicer
// Changed Sniper code and Cam code // Changed Sniper code and Cam code
// //
@ -2752,7 +2758,8 @@ static void CG_Draw2D( void ) {
*/ */
//Slicer: Adding HUD for follow spectating //Slicer: Adding HUD for follow spectating
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR && !(cg.snap->ps.pm_flags & PMF_FOLLOW) ) { 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_DrawCrosshair();
CG_DrawCrosshairNames(); CG_DrawCrosshairNames();
} else { } else {

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.46 2002/02/11 00:30:23 niceass
// LCA fix // LCA fix
// //
@ -569,6 +575,7 @@ typedef enum {
PERS_GAUNTLET_FRAG_COUNT, // kills with the guantlet PERS_GAUNTLET_FRAG_COUNT, // kills with the guantlet
PERS_CAPTURES // captures 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 PERS_WEAPONMODES // Blaze: Holds the different weapond modes for the different guns see below for the defines to use
} persEnum_t; } 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 //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

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // 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 // Added debugging to help find what was going with can't find item for weapon
// error that crash the server. // error that crash the server.
@ -1473,13 +1479,13 @@ void ClientThink_real( gentity_t *ent ) {
if (level.time > client->respawnTime) { if (level.time > client->respawnTime) {
// forcerespawn is to prevent users from waiting out powerups // forcerespawn is to prevent users from waiting out powerups
if (g_forcerespawn.integer > 0 && if (g_forcerespawn.integer > 0 &&
(level.time - client->respawnTime ) > g_forcerespawn.integer * 1000) { (level.time - client->respawnTime ) > g_forcerespawn.integer * 1000 &&
if (g_gametype.integer == GT_TEAMPLAY) { g_gametype.integer != GT_TEAMPLAY) {
MakeSpectator(ent);
} else {
respawn( ent ); 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 // pressing attack or use is the normal respawn method

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.54 2002/02/25 17:54:57 jbravo
// Added [DEAD] tags infront of players names where appropriate and made // Added [DEAD] tags infront of players names where appropriate and made
// the server log conversation like AQ does. // the server log conversation like AQ does.
@ -728,6 +734,7 @@ void SetTeam( gentity_t *ent, char *s )
client->sess.sessionTeam = team; client->sess.sessionTeam = team;
} else if ( !client->sess.teamSpawn ) { } else if ( !client->sess.teamSpawn ) {
client->sess.savedTeam = team; client->sess.savedTeam = team;
client->ps.persistant[PERS_SAVEDTEAM] = team;
} else { } else {
client->sess.sessionTeam = team; client->sess.sessionTeam = team;
} }

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.44 2002/02/24 18:49:21 jbravo
// Make it OK to frag teammates after rounds are over (no -1) // 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 #endif
Cmd_Score_f(self); // show scores // JBravo: no need for automatic scoreboard on deaths.
// send updated scores to any clients that are following this one, if (g_gametype.integer != GT_TEAMPLAY) {
// or they would get stale scoreboards Cmd_Score_f(self); // show scores
for (i = 0 ; i < level.maxclients ; i++) { // send updated scores to any clients that are following this one,
gclient_t *client; // or they would get stale scoreboards
for (i = 0 ; i < level.maxclients ; i++) {
client = &level.clients[i]; gclient_t *client;
if (client->pers.connected != CON_CONNECTED) {
continue; client = &level.clients[i];
} if (client->pers.connected != CON_CONNECTED) {
if (client->sess.sessionTeam != TEAM_SPECTATOR) { continue;
continue; }
} if (client->sess.sessionTeam != TEAM_SPECTATOR) {
if (client->sess.spectatorClient == self->s.number) { continue;
Cmd_Score_f(g_entities + i); }
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 // g_forcerespawn may force spawning at some later time
// JBravo: we dont want automatic respawning of players in teamplay // JBravo: we dont want automatic respawning of players in teamplay
if (g_gametype.integer == GT_TEAMPLAY) { if (g_gametype.integer == GT_TEAMPLAY) {
self->client->respawnTime = level.time + 400; self->client->respawnTime = level.time + 1000;
} else { } else {
self->client->respawnTime = level.time + 1700; self->client->respawnTime = level.time + 1700;
} }

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.8 2002/02/09 00:10:12 jbravo
// Fixed spectator follow and free and updated zcam to 1.04 and added the // Fixed spectator follow and free and updated zcam to 1.04 and added the
// missing zcam files. // missing zcam files.
@ -126,6 +132,9 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) {
sess->savedTeam = TEAM_SPECTATOR; sess->savedTeam = TEAM_SPECTATOR;
// JBravo: adding PERS_SAVEDTEAM
client->ps.persistant[PERS_SAVEDTEAM] = TEAM_SPECTATOR;
// initial team determination // initial team determination
if ( g_gametype.integer >= GT_TEAM ) { if ( g_gametype.integer >= GT_TEAM ) {
if ( g_teamAutoJoin.integer ) { if ( g_teamAutoJoin.integer ) {

View file

@ -5,6 +5,12 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // 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 // Added a cvar to control sniper behavior g_RQ3_sniperup. Def 0. if set yo 1
// it makes players spawn with the sniper up. // it makes players spawn with the sniper up.
@ -250,6 +256,7 @@ void MakeAllLivePlayersObservers()
if (!player->inuse || player->client->ps.pm_type != PM_NORMAL) if (!player->inuse || player->client->ps.pm_type != PM_NORMAL)
continue; continue;
level.clients[i].sess.savedTeam = level.clients[i].sess.sessionTeam; 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.sessionTeam = TEAM_SPECTATOR;
level.clients[i].sess.spectatorState = SPECTATOR_FREE; level.clients[i].sess.spectatorState = SPECTATOR_FREE;
} }
@ -700,6 +707,7 @@ void MakeSpectator( gentity_t *ent )
client->weaponCount[ent->client->ps.weapon] = 0; client->weaponCount[ent->client->ps.weapon] = 0;
client->ps.stats[STAT_WEAPONS] = 0; client->ps.stats[STAT_WEAPONS] = 0;
client->sess.savedTeam = client->sess.sessionTeam; client->sess.savedTeam = client->sess.sessionTeam;
client->ps.persistant[PERS_SAVEDTEAM] = client->sess.sessionTeam;
client->sess.sessionTeam = TEAM_SPECTATOR; client->sess.sessionTeam = TEAM_SPECTATOR;
client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR; client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR;
ClientSpawn(ent); ClientSpawn(ent);