mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-11 07:42:15 +00:00
Fixed a few bugs and did some cleanups
This commit is contained in:
parent
5197b4401d
commit
a38c90e2d8
4 changed files with 62 additions and 46 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.53 2002/02/22 02:13:13 jbravo
|
||||
// Fixed a few bugs and did some cleanups
|
||||
//
|
||||
// Revision 1.52 2002/02/10 21:21:22 slicer
|
||||
// Saving persistant and other data on some events..
|
||||
//
|
||||
|
@ -791,6 +794,10 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
if ( g_dmflags.integer & DF_NO_FALLING ) {
|
||||
break;
|
||||
}
|
||||
// JBravo: fix falling pain during lca
|
||||
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action) {
|
||||
break;
|
||||
}
|
||||
|
||||
damage = ent->client->ps.stats[STAT_FALLDAMAGE];
|
||||
VectorSet (dir, 0, 0, 1);
|
||||
|
@ -817,6 +824,10 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
if ( g_dmflags.integer & DF_NO_FALLING ) {
|
||||
break;
|
||||
}
|
||||
// JBravo: fix falling pain during lca again
|
||||
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action) {
|
||||
break;
|
||||
}
|
||||
|
||||
damage = ent->client->ps.stats[STAT_FALLDAMAGE];
|
||||
VectorSet (dir, 0, 0, 1);
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.52 2002/02/22 02:13:13 jbravo
|
||||
// Fixed a few bugs and did some cleanups
|
||||
//
|
||||
// Revision 1.51 2002/02/10 22:02:06 niceass
|
||||
// took some debug info out
|
||||
//
|
||||
|
@ -589,22 +592,24 @@ void BroadcastTeamChange( gclient_t *client, int oldTeam )
|
|||
SetTeam
|
||||
=================
|
||||
*/
|
||||
void SetTeam( gentity_t *ent, char *s ) {
|
||||
int team, oldTeam;
|
||||
gclient_t *client;
|
||||
int clientNum;
|
||||
void SetTeam( gentity_t *ent, char *s )
|
||||
{
|
||||
int team, oldTeam, clientNum;
|
||||
gclient_t *client;
|
||||
spectatorState_t specState;
|
||||
int specClient;
|
||||
int teamLeader, teamsave;
|
||||
int specClient, teamLeader, teamsave;
|
||||
|
||||
//
|
||||
// see what change is requested
|
||||
//
|
||||
client = ent->client;
|
||||
|
||||
clientNum = client - level.clients;
|
||||
specClient = 0;
|
||||
specState = SPECTATOR_NOT;
|
||||
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
specClient = 0;
|
||||
specState = SPECTATOR_NOT;
|
||||
}
|
||||
|
||||
if ( !Q_stricmp( s, "scoreboard" ) || !Q_stricmp( s, "score" ) ) {
|
||||
team = TEAM_SPECTATOR;
|
||||
specState = SPECTATOR_SCOREBOARD;
|
||||
|
@ -623,8 +628,8 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
specState = SPECTATOR_FREE;
|
||||
} else if ( g_gametype.integer >= GT_TEAM ) {
|
||||
// if running a team game, assign player to one of the teams
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
specState = SPECTATOR_NOT;
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
specState = SPECTATOR_NOT;
|
||||
}
|
||||
if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) || !Q_stricmp( s, "1") ) {
|
||||
team = TEAM_RED;
|
||||
|
@ -677,7 +682,7 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
oldTeam = client->sess.savedTeam;
|
||||
} else {
|
||||
oldTeam = client->sess.sessionTeam;
|
||||
oldTeam = client->sess.sessionTeam;
|
||||
}
|
||||
if ( team == oldTeam ) {
|
||||
return;
|
||||
|
@ -702,8 +707,8 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
|
||||
// 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 ((oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE) &&
|
||||
ent->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;
|
||||
|
@ -761,7 +766,7 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
|
||||
// JBravo: to avoid messages when players are killed and move to spectator team.
|
||||
if ( client->sess.savedTeam != TEAM_RED && client->sess.savedTeam != TEAM_BLUE && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
BroadcastTeamChange( client, oldTeam );
|
||||
BroadcastTeamChange( client, oldTeam );
|
||||
}
|
||||
|
||||
// get and distribute relevent paramters
|
||||
|
@ -775,10 +780,11 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
ClientUserinfoChanged( clientNum );
|
||||
client->sess.sessionTeam = teamsave;
|
||||
} else {
|
||||
ClientUserinfoChanged( clientNum );
|
||||
ClientUserinfoChanged( clientNum );
|
||||
ClientBegin( clientNum );
|
||||
}
|
||||
|
||||
ClientBegin( clientNum );
|
||||
// ClientBegin( clientNum );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -821,21 +827,21 @@ void Cmd_Team_f( gentity_t *ent ) {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
oldTeam = ent->client->sess.sessionTeam;
|
||||
switch ( oldTeam ) {
|
||||
case TEAM_BLUE:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Blue team\n\"" );
|
||||
break;
|
||||
case TEAM_RED:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Red team\n\"" );
|
||||
break;
|
||||
case TEAM_FREE:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Free team\n\"" );
|
||||
break;
|
||||
case TEAM_SPECTATOR:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Spectator team\n\"" );
|
||||
break;
|
||||
}
|
||||
oldTeam = ent->client->sess.sessionTeam;
|
||||
switch ( oldTeam ) {
|
||||
case TEAM_BLUE:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Blue team\n\"" );
|
||||
break;
|
||||
case TEAM_RED:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Red team\n\"" );
|
||||
break;
|
||||
case TEAM_FREE:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Free team\n\"" );
|
||||
break;
|
||||
case TEAM_SPECTATOR:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Spectator team\n\"" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.43 2002/02/22 02:13:13 jbravo
|
||||
// Fixed a few bugs and did some cleanups
|
||||
//
|
||||
// Revision 1.42 2002/02/10 21:21:23 slicer
|
||||
// Saving persistant and other data on some events..
|
||||
//
|
||||
|
@ -599,6 +602,12 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
|
||||
//Elder: stop reload attempts
|
||||
self->client->reloadAttempts = 0;
|
||||
|
||||
//JBravo: switch off the lasersight
|
||||
if (self->client->lasersight) {
|
||||
G_FreeEntity(self->client->lasersight);
|
||||
self->client->lasersight = NULL;
|
||||
}
|
||||
}
|
||||
if (self->client->ps.pm_type == PM_DEAD) {
|
||||
return;
|
||||
|
@ -616,13 +625,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
CheckAlmostScored( self, attacker );
|
||||
}
|
||||
|
||||
// JBravo: save client->ps so spectating wont zap it.
|
||||
/* if (g_gametype.integer == GT_TEAMPLAY) {
|
||||
for (i = 0 ; i < MAX_PERSISTANT ; i++) {
|
||||
self->client->savedpersistant[i] = self->client->ps.persistant[i];
|
||||
}
|
||||
}*/
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
||||
self->client->ps.eFlags &= ~EF_TICKING;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.16 2002/02/22 02:13:13 jbravo
|
||||
// Fixed a few bugs and did some cleanups
|
||||
//
|
||||
// Revision 1.15 2002/02/11 00:30:23 niceass
|
||||
// LCA fix
|
||||
//
|
||||
|
@ -237,7 +240,7 @@ void MakeAllLivePlayersObservers()
|
|||
continue;
|
||||
level.clients[i].sess.savedTeam = level.clients[i].sess.sessionTeam;
|
||||
level.clients[i].sess.sessionTeam = TEAM_SPECTATOR;
|
||||
level.clients[i].sess.spectatorState = SPECTATOR_FOLLOW;
|
||||
level.clients[i].sess.spectatorState = SPECTATOR_FREE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -471,10 +474,6 @@ void SpawnPlayers()
|
|||
client = player->client;
|
||||
clientNum = client - level.clients;
|
||||
|
||||
// for (x = 0 ; x < MAX_PERSISTANT ; x++) {
|
||||
// client->ps.persistant[x] = client->savedpersistant[x];
|
||||
// }
|
||||
|
||||
client->sess.teamSpawn = qtrue;
|
||||
if (client->sess.savedTeam == TEAM_RED) {
|
||||
client->sess.sessionTeam = TEAM_RED;
|
||||
|
@ -501,8 +500,6 @@ void RQ3_Cmd_Choose_f( gentity_t *ent )
|
|||
return; // not fully in game yet
|
||||
}
|
||||
|
||||
// trap_Argv( 1, cmd, sizeof( cmd ) );
|
||||
|
||||
cmd = ConcatArgs( 1 );
|
||||
|
||||
if (Q_stricmp (cmd, RQ3_MP5_NAME) == 0 || Q_stricmp (cmd, "mp5") == 0) {
|
||||
|
|
Loading…
Reference in a new issue