Remember specstate between rounds.

This commit is contained in:
Richard Allen 2002-03-26 11:32:05 +00:00
parent c7ff311b9c
commit 8d155cd9cd
6 changed files with 35 additions and 4 deletions

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.62 2002/03/26 11:32:04 jbravo
// Remember specstate between rounds.
//
// Revision 1.61 2002/03/23 21:29:42 jbravo
// I finally fixed snipers spawning with pistol up. g_RQ3_sniperup has been
// reinstated.
@ -546,6 +549,7 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) {
if((ucmd->buttons & BUTTON_ATTACK) && !( client->oldbuttons & BUTTON_ATTACK )) {
if (client->sess.spectatorState == SPECTATOR_FREE && OKtoFollow(clientNum)) {
client->sess.spectatorState = SPECTATOR_FOLLOW;
client->specMode = SPECTATOR_FOLLOW;
client->ps.pm_flags |= PMF_FOLLOW;
Cmd_FollowCycle_f( ent, 1 );
} else {
@ -1607,6 +1611,8 @@ void SpectatorClientEndFrame( gentity_t *ent ) {
// drop them to free spectators unless they are dedicated camera followers
if ( ent->client->sess.spectatorClient >= 0 ) {
ent->client->sess.spectatorState = SPECTATOR_FREE;
// JBravo: saving spectatorState
ent->client->specMode = SPECTATOR_FREE;
ClientBegin( ent->client - level.clients );
}
}

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.54 2002/03/26 11:32:04 jbravo
// Remember specstate between rounds.
//
// Revision 1.53 2002/03/26 10:32:52 jbravo
// Bye bye LCA lag
//
@ -1323,7 +1326,7 @@ void ClientSpawn(gentity_t *ent) {
// char *savedAreaBits;
int accuracy_hits, accuracy_shots;
int eventSequence;
int savedWeapon, savedItem; // JBravo: to save weapon/item info
int savedWeapon, savedItem, savedSpec; // JBravo: to save weapon/item info
int savedRadiopower, savedRadiogender; // JBravo: for radio.
char userinfo[MAX_INFO_STRING];
@ -1357,6 +1360,11 @@ void ClientSpawn(gentity_t *ent) {
if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
spawnPoint = SelectSpectatorSpawnPoint (
spawn_origin, spawn_angles);
// JBravo: remember saved specmodes.
if (g_gametype.integer == GT_TEAMPLAY) {
if (client->specMode == SPECTATOR_FOLLOW || client->specMode == SPECTATOR_FREE)
client->sess.spectatorState = client->specMode;
}
} else if (g_gametype.integer >= GT_CTF ) {
// all base oriented team games use the CTF spawn points
spawnPoint = SelectCTFSpawnPoint (
@ -1431,6 +1439,7 @@ void ClientSpawn(gentity_t *ent) {
// JBravo: save weapon/item info
savedWeapon = client->teamplayWeapon;
savedItem = client->teamplayItem;
savedSpec = client->specMode;
// JBravo: save radiosettings
savedRadiopower = client->radioOff;
savedRadiogender = client->radioGender;
@ -1440,6 +1449,7 @@ void ClientSpawn(gentity_t *ent) {
// JBravo: restore weapon/item info
client->teamplayWeapon = savedWeapon;
client->teamplayItem = savedItem;
client->specMode = savedSpec;
// JBravo: restore radiosettings
client->radioOff = savedRadiopower;
client->radioGender = savedRadiogender;

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.82 2002/03/26 11:32:05 jbravo
// Remember specstate between rounds.
//
// Revision 1.81 2002/03/23 05:17:42 jbravo
// Major cleanup of game -> cgame communication with LCA vars.
//
@ -969,6 +972,7 @@ void StopFollowing( gentity_t *ent ) {
ent->client->ps.persistant[ PERS_TEAM ] = TEAM_SPECTATOR;
ent->client->sess.sessionTeam = TEAM_SPECTATOR;
ent->client->sess.spectatorState = SPECTATOR_FREE;
ent->client->specMode = SPECTATOR_FREE;
//Slicer - Removing any zoom bits he might have gainned
Cmd_Unzoom(ent);
ent->client->ps.pm_flags &= ~PMF_FOLLOW;
@ -1083,6 +1087,7 @@ void Cmd_Follow_f( gentity_t *ent ) {
}
ent->client->sess.spectatorState = SPECTATOR_FOLLOW;
ent->client->specMode = SPECTATOR_FOLLOW;
ent->client->sess.spectatorClient = i;
}
@ -1141,6 +1146,7 @@ void Cmd_FollowCycle_f( gentity_t *ent, int dir ) {
// this is good, we can use it
ent->client->sess.spectatorClient = clientnum;
ent->client->sess.spectatorState = SPECTATOR_FOLLOW;
ent->client->specMode = SPECTATOR_FOLLOW;
return;
} while ( clientnum != original );

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.59 2002/03/26 11:32:05 jbravo
// Remember specstate between rounds.
//
// Revision 1.58 2002/03/26 10:32:52 jbravo
// Bye bye LCA lag
//
@ -576,6 +579,7 @@ struct gclient_s {
struct camera_s *camera;
#endif /* __ZCAM__ */
// JBravo adding TP stuff
int specMode;
int teamplayWeapon;
int teamplayItem;
int radioGender;

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.12 2002/03/26 11:32:05 jbravo
// Remember specstate between rounds.
//
// Revision 1.11 2002/03/18 17:52:36 slicer
// Saved sess.savedTeam throught map changes for matchmode
//
@ -193,6 +196,7 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) {
}
sess->spectatorState = SPECTATOR_FREE;
client->specMode = SPECTATOR_FREE;
sess->spectatorTime = level.time;
G_WriteClientSessionData( client );

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.46 2002/03/26 11:32:05 jbravo
// Remember specstate between rounds.
//
// Revision 1.45 2002/03/26 10:32:52 jbravo
// Bye bye LCA lag
//
@ -865,11 +868,9 @@ void MakeSpectator( gentity_t *ent )
client->weaponCount[ent->client->ps.weapon] = 0;
client->ps.stats[STAT_WEAPONS] = 0;
//Slicer, commenting this, fixes a lot..savedTeam is always accurate, no need to change it here
// 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;
client->sess.spectatorState = client->specMode;
ClientSpawn(ent);
}