Fixed death on switching teams while dead

This commit is contained in:
Richard Allen 2002-02-26 21:59:10 +00:00
parent bbe8669869
commit fcc69b27aa
2 changed files with 17 additions and 6 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.38 2002/02/26 02:58:47 jbravo
// Fixing the spectator_free mode not being predicted in the client. // 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 // JBravo: Antistick
client->ps.stats[STAT_RQ3] &= ~RQ3_PLAYERSOLID; client->ps.stats[STAT_RQ3] &= ~RQ3_PLAYERSOLID;
// JBravo: Clear zcam flag for cgame
client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM; client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM;
// read or initialize the session data // 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 // count current clients and rank for scoreboard
CalculateRanks(); 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 // for statistics
// client->areabits = areabits; // client->areabits = areabits;
// if ( !client->areabits ) // if ( !client->areabits )
@ -1194,11 +1204,11 @@ void ClientBegin( int clientNum ) {
client->sess.sessionTeam = TEAM_SPECTATOR; client->sess.sessionTeam = TEAM_SPECTATOR;
client->sess.spectatorState = SPECTATOR_FREE; client->sess.spectatorState = SPECTATOR_FREE;
#ifdef __ZCAM__ #ifdef __ZCAM__
client->camera->mode = CAMERA_MODE_FLIC; client->camera->mode = CAMERA_MODE_SWING;
#endif #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_GRENSHORT; //set to short range
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.58 2002/02/26 04:59:10 jbravo
// Fixed teamswitching and team broadcasting // Fixed teamswitching and team broadcasting
// //
@ -731,14 +734,12 @@ void SetTeam( gentity_t *ent, char *s )
client->pers.teamState.state = TEAM_BEGIN; client->pers.teamState.state = TEAM_BEGIN;
// JBravo: if player is changing from FREE or SPECT. there is no need for violence. // 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 (client->sess.sessionTeam != TEAM_SPECTATOR && client->sess.sessionTeam != TEAM_FREE &&
if ((oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE) && client->ps.pm_type == PM_NORMAL) {
ent->client->ps.pm_type == PM_NORMAL) {
// Kill him (makes sure he loses flags, etc) // Kill him (makes sure he loses flags, etc)
ent->flags &= ~FL_GODMODE; ent->flags &= ~FL_GODMODE;
ent->client->ps.stats[STAT_HEALTH] = ent->health = 0; ent->client->ps.stats[STAT_HEALTH] = ent->health = 0;
player_die (ent, ent, ent, 100000, MOD_SUICIDE); player_die (ent, ent, ent, 100000, MOD_SUICIDE);
} }
// JBravo: lets set the correct var here. // JBravo: lets set the correct var here.