mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-26 22:21:16 +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$
|
// $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
|
// Revision 1.52 2002/02/10 21:21:22 slicer
|
||||||
// Saving persistant and other data on some events..
|
// 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 ) {
|
if ( g_dmflags.integer & DF_NO_FALLING ) {
|
||||||
break;
|
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];
|
damage = ent->client->ps.stats[STAT_FALLDAMAGE];
|
||||||
VectorSet (dir, 0, 0, 1);
|
VectorSet (dir, 0, 0, 1);
|
||||||
|
@ -817,6 +824,10 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
||||||
if ( g_dmflags.integer & DF_NO_FALLING ) {
|
if ( g_dmflags.integer & DF_NO_FALLING ) {
|
||||||
break;
|
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];
|
damage = ent->client->ps.stats[STAT_FALLDAMAGE];
|
||||||
VectorSet (dir, 0, 0, 1);
|
VectorSet (dir, 0, 0, 1);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.51 2002/02/10 22:02:06 niceass
|
||||||
// took some debug info out
|
// took some debug info out
|
||||||
//
|
//
|
||||||
|
@ -589,22 +592,24 @@ void BroadcastTeamChange( gclient_t *client, int oldTeam )
|
||||||
SetTeam
|
SetTeam
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void SetTeam( gentity_t *ent, char *s ) {
|
void SetTeam( gentity_t *ent, char *s )
|
||||||
int team, oldTeam;
|
{
|
||||||
gclient_t *client;
|
int team, oldTeam, clientNum;
|
||||||
int clientNum;
|
gclient_t *client;
|
||||||
spectatorState_t specState;
|
spectatorState_t specState;
|
||||||
int specClient;
|
int specClient, teamLeader, teamsave;
|
||||||
int teamLeader, teamsave;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// see what change is requested
|
// see what change is requested
|
||||||
//
|
//
|
||||||
client = ent->client;
|
client = ent->client;
|
||||||
|
|
||||||
clientNum = client - level.clients;
|
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" ) ) {
|
if ( !Q_stricmp( s, "scoreboard" ) || !Q_stricmp( s, "score" ) ) {
|
||||||
team = TEAM_SPECTATOR;
|
team = TEAM_SPECTATOR;
|
||||||
specState = SPECTATOR_SCOREBOARD;
|
specState = SPECTATOR_SCOREBOARD;
|
||||||
|
@ -623,8 +628,8 @@ void SetTeam( gentity_t *ent, char *s ) {
|
||||||
specState = SPECTATOR_FREE;
|
specState = SPECTATOR_FREE;
|
||||||
} else if ( g_gametype.integer >= GT_TEAM ) {
|
} else if ( g_gametype.integer >= GT_TEAM ) {
|
||||||
// if running a team game, assign player to one of the teams
|
// if running a team game, assign player to one of the teams
|
||||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
specState = SPECTATOR_NOT;
|
specState = SPECTATOR_NOT;
|
||||||
}
|
}
|
||||||
if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) || !Q_stricmp( s, "1") ) {
|
if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) || !Q_stricmp( s, "1") ) {
|
||||||
team = TEAM_RED;
|
team = TEAM_RED;
|
||||||
|
@ -677,7 +682,7 @@ void SetTeam( gentity_t *ent, char *s ) {
|
||||||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||||
oldTeam = client->sess.savedTeam;
|
oldTeam = client->sess.savedTeam;
|
||||||
} else {
|
} else {
|
||||||
oldTeam = client->sess.sessionTeam;
|
oldTeam = client->sess.sessionTeam;
|
||||||
}
|
}
|
||||||
if ( team == oldTeam ) {
|
if ( team == oldTeam ) {
|
||||||
return;
|
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.
|
// 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
|
//Slicer: If he's dead no need for violence too
|
||||||
if ( (oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE) &&
|
if ((oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE) &&
|
||||||
ent->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;
|
||||||
|
@ -761,7 +766,7 @@ void SetTeam( gentity_t *ent, char *s ) {
|
||||||
|
|
||||||
// JBravo: to avoid messages when players are killed and move to spectator team.
|
// 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 ) {
|
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
|
// get and distribute relevent paramters
|
||||||
|
@ -775,10 +780,11 @@ void SetTeam( gentity_t *ent, char *s ) {
|
||||||
ClientUserinfoChanged( clientNum );
|
ClientUserinfoChanged( clientNum );
|
||||||
client->sess.sessionTeam = teamsave;
|
client->sess.sessionTeam = teamsave;
|
||||||
} else {
|
} else {
|
||||||
ClientUserinfoChanged( clientNum );
|
ClientUserinfoChanged( clientNum );
|
||||||
|
ClientBegin( clientNum );
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientBegin( clientNum );
|
// ClientBegin( clientNum );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -821,21 +827,21 @@ void Cmd_Team_f( gentity_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oldTeam = ent->client->sess.sessionTeam;
|
oldTeam = ent->client->sess.sessionTeam;
|
||||||
switch ( oldTeam ) {
|
switch ( oldTeam ) {
|
||||||
case TEAM_BLUE:
|
case TEAM_BLUE:
|
||||||
trap_SendServerCommand( ent-g_entities, "print \"Blue team\n\"" );
|
trap_SendServerCommand( ent-g_entities, "print \"Blue team\n\"" );
|
||||||
break;
|
break;
|
||||||
case TEAM_RED:
|
case TEAM_RED:
|
||||||
trap_SendServerCommand( ent-g_entities, "print \"Red team\n\"" );
|
trap_SendServerCommand( ent-g_entities, "print \"Red team\n\"" );
|
||||||
break;
|
break;
|
||||||
case TEAM_FREE:
|
case TEAM_FREE:
|
||||||
trap_SendServerCommand( ent-g_entities, "print \"Free team\n\"" );
|
trap_SendServerCommand( ent-g_entities, "print \"Free team\n\"" );
|
||||||
break;
|
break;
|
||||||
case TEAM_SPECTATOR:
|
case TEAM_SPECTATOR:
|
||||||
trap_SendServerCommand( ent-g_entities, "print \"Spectator team\n\"" );
|
trap_SendServerCommand( ent-g_entities, "print \"Spectator team\n\"" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.42 2002/02/10 21:21:23 slicer
|
||||||
// Saving persistant and other data on some events..
|
// 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
|
//Elder: stop reload attempts
|
||||||
self->client->reloadAttempts = 0;
|
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) {
|
if (self->client->ps.pm_type == PM_DEAD) {
|
||||||
return;
|
return;
|
||||||
|
@ -616,13 +625,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
CheckAlmostScored( self, attacker );
|
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
|
#ifdef MISSIONPACK
|
||||||
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
||||||
self->client->ps.eFlags &= ~EF_TICKING;
|
self->client->ps.eFlags &= ~EF_TICKING;
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $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
|
// Revision 1.15 2002/02/11 00:30:23 niceass
|
||||||
// LCA fix
|
// LCA fix
|
||||||
//
|
//
|
||||||
|
@ -237,7 +240,7 @@ void MakeAllLivePlayersObservers()
|
||||||
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].sess.sessionTeam = TEAM_SPECTATOR;
|
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;
|
client = player->client;
|
||||||
clientNum = client - level.clients;
|
clientNum = client - level.clients;
|
||||||
|
|
||||||
// for (x = 0 ; x < MAX_PERSISTANT ; x++) {
|
|
||||||
// client->ps.persistant[x] = client->savedpersistant[x];
|
|
||||||
// }
|
|
||||||
|
|
||||||
client->sess.teamSpawn = qtrue;
|
client->sess.teamSpawn = qtrue;
|
||||||
if (client->sess.savedTeam == TEAM_RED) {
|
if (client->sess.savedTeam == TEAM_RED) {
|
||||||
client->sess.sessionTeam = 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
|
return; // not fully in game yet
|
||||||
}
|
}
|
||||||
|
|
||||||
// trap_Argv( 1, cmd, sizeof( cmd ) );
|
|
||||||
|
|
||||||
cmd = ConcatArgs( 1 );
|
cmd = ConcatArgs( 1 );
|
||||||
|
|
||||||
if (Q_stricmp (cmd, RQ3_MP5_NAME) == 0 || Q_stricmp (cmd, "mp5") == 0) {
|
if (Q_stricmp (cmd, RQ3_MP5_NAME) == 0 || Q_stricmp (cmd, "mp5") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue