summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c183
1 files changed, 89 insertions, 94 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index cf72c427..89183be0 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -251,8 +251,8 @@ void ScoreboardMessage( gentity_t *ent )
else
ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
- if( cl->sess.sessionTeam != TEAM_SPECTATOR &&
- ( ent->client->pers.teamSelection == PTE_NONE ||
+ if( cl->sess.spectatorState == SPECTATOR_NOT &&
+ ( ent->client->pers.teamSelection == TEAM_NONE ||
cl->pers.teamSelection == ent->client->pers.teamSelection ) )
{
weapon = cl->ps.weapon;
@@ -366,7 +366,7 @@ void Cmd_Give_f( gentity_t *ent )
if( Q_stricmp( name, "poison" ) == 0 )
{
- if( ent->client->pers.teamSelection == PTE_HUMANS )
+ if( ent->client->pers.teamSelection == TEAM_HUMANS )
{
ent->client->ps.stats[ STAT_STATE ] |= SS_POISONED;
ent->client->lastPoisonTime = level.time;
@@ -530,13 +530,13 @@ G_LeaveTeam
*/
void G_LeaveTeam( gentity_t *self )
{
- pTeam_t team = self->client->pers.teamSelection;
+ team_t team = self->client->pers.teamSelection;
gentity_t *ent;
int i;
- if( team == PTE_ALIENS )
+ if( team == TEAM_ALIENS )
G_RemoveFromSpawnQueue( &level.alienSpawnQueue, self->client->ps.clientNum );
- else if( team == PTE_HUMANS )
+ else if( team == TEAM_HUMANS )
G_RemoveFromSpawnQueue( &level.humanSpawnQueue, self->client->ps.clientNum );
else
{
@@ -574,9 +574,9 @@ void G_LeaveTeam( gentity_t *self )
G_ChangeTeam
=================
*/
-void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam )
+void G_ChangeTeam( gentity_t *ent, team_t newTeam )
{
- pTeam_t oldTeam = ent->client->pers.teamSelection;
+ team_t oldTeam = ent->client->pers.teamSelection;
if( oldTeam == newTeam )
return;
@@ -599,8 +599,8 @@ Cmd_Team_f
*/
void Cmd_Team_f( gentity_t *ent )
{
- pTeam_t team;
- pTeam_t oldteam = ent->client->pers.teamSelection;
+ team_t team;
+ team_t oldteam = ent->client->pers.teamSelection;
char s[ MAX_TOKEN_CHARS ];
qboolean force = G_admin_permission(ent, ADMF_FORCETEAMCHANGE);
int aliens = level.numAlienClients;
@@ -610,9 +610,9 @@ void Cmd_Team_f( gentity_t *ent )
if( level.time - ent->client->pers.teamChangeTime < 1000 )
return;
- if( oldteam == PTE_ALIENS )
+ if( oldteam == TEAM_ALIENS )
aliens--;
- else if( oldteam == PTE_HUMANS )
+ else if( oldteam == TEAM_HUMANS )
humans--;
trap_Argv( 1, s, sizeof( s ) );
@@ -625,8 +625,8 @@ void Cmd_Team_f( gentity_t *ent )
}
if( !Q_stricmp( s, "spectate" ) )
- team = PTE_NONE;
- else if( !force && oldteam == PTE_NONE && g_maxGameClients.integer &&
+ team = TEAM_NONE;
+ else if( !force && oldteam == TEAM_NONE && g_maxGameClients.integer &&
level.numPlayingClients >= g_maxGameClients.integer )
{
trap_SendServerCommand( ent-g_entities, va( "print \"The maximum number of "
@@ -655,7 +655,7 @@ void Cmd_Team_f( gentity_t *ent )
return;
}
- team = PTE_ALIENS;
+ team = TEAM_ALIENS;
}
else if( !Q_stricmp( s, "humans" ) )
{
@@ -678,23 +678,23 @@ void Cmd_Team_f( gentity_t *ent )
return;
}
- team = PTE_HUMANS;
+ team = TEAM_HUMANS;
}
else if( !Q_stricmp( s, "auto" ) )
{
if( level.humanTeamLocked && level.alienTeamLocked )
- team = PTE_NONE;
+ team = TEAM_NONE;
else if( humans > aliens )
- team = PTE_ALIENS;
+ team = TEAM_ALIENS;
else if( humans < aliens )
- team = PTE_HUMANS;
+ team = TEAM_HUMANS;
else
- team = PTE_ALIENS + ( rand( ) % 2 );
+ team = TEAM_ALIENS + ( rand( ) % 2 );
- if( team == PTE_ALIENS && level.alienTeamLocked )
- team = PTE_HUMANS;
- else if( team == PTE_HUMANS && level.humanTeamLocked )
- team = PTE_ALIENS;
+ if( team == TEAM_ALIENS && level.alienTeamLocked )
+ team = TEAM_HUMANS;
+ else if( team == TEAM_HUMANS && level.humanTeamLocked )
+ team = TEAM_ALIENS;
}
else
{
@@ -707,13 +707,13 @@ void Cmd_Team_f( gentity_t *ent )
return;
//guard against build timer exploit
- if( oldteam != PTE_NONE && ent->client->sess.sessionTeam != TEAM_SPECTATOR &&
- ( ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 ||
- ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG ||
+ if( oldteam != TEAM_NONE && ent->client->sess.spectatorState == SPECTATOR_NOT &&
+ ( ent->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0 ||
+ ent->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ||
BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) ) &&
ent->client->ps.stats[ STAT_MISC ] > 0 )
{
- if( ent->client->pers.teamSelection == PTE_ALIENS )
+ if( ent->client->pers.teamSelection == TEAM_ALIENS )
G_TriggerMenu( ent->client->ps.clientNum, MN_A_TEAMCHANGEBUILDTIMER );
else
G_TriggerMenu( ent->client->ps.clientNum, MN_H_TEAMCHANGEBUILDTIMER );
@@ -723,9 +723,9 @@ void Cmd_Team_f( gentity_t *ent )
G_ChangeTeam( ent, team );
- if( team == PTE_ALIENS )
+ if( team == TEAM_ALIENS )
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the aliens\n\"", ent->client->pers.netname ) );
- else if( team == PTE_HUMANS )
+ else if( team == TEAM_HUMANS )
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " joined the humans\n\"", ent->client->pers.netname ) );
}
@@ -753,7 +753,7 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons
if( mode == SAY_TEAM && !OnSameTeam( ent, other ) )
{
- if( other->client->pers.teamSelection != PTE_NONE )
+ if( other->client->pers.teamSelection != TEAM_NONE )
return;
if( !G_admin_permission( other, ADMF_SPEC_ALLCHAT ) )
@@ -789,15 +789,15 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
switch( ent->client->pers.teamSelection )
{
default:
- case PTE_NONE:
+ case TEAM_NONE:
prefix = "[S] ";
break;
- case PTE_ALIENS:
+ case TEAM_ALIENS:
prefix = "[A] ";
break;
- case PTE_HUMANS:
+ case TEAM_HUMANS:
prefix = "[H] ";
}
}
@@ -1192,7 +1192,7 @@ void Cmd_CallTeamVote_f( gentity_t *ent )
team = ent->client->pers.teamSelection;
- if( team == PTE_ALIENS )
+ if( team == TEAM_ALIENS )
cs_offset = 1;
if( !g_allowVote.integer )
@@ -1367,7 +1367,7 @@ void Cmd_CallTeamVote_f( gentity_t *ent )
for( i = 0; i < level.maxclients; i++ )
{
- if( level.clients[ i ].ps.stats[ STAT_PTEAM ] == team )
+ if( level.clients[ i ].ps.stats[ STAT_TEAM ] == team )
level.clients[ i ].ps.eFlags &= ~EF_TEAMVOTED;
}
@@ -1392,7 +1392,7 @@ void Cmd_TeamVote_f( gentity_t *ent )
int cs_offset = 0;
char msg[ 64 ];
- if( ent->client->pers.teamSelection == PTE_ALIENS )
+ if( ent->client->pers.teamSelection == TEAM_ALIENS )
cs_offset = 1;
if( !level.teamVoteTime[ cs_offset ] )
@@ -1451,8 +1451,7 @@ void Cmd_SetViewpos_f( gentity_t *ent )
#define AS_OVER_RT3 ((ALIENSENSE_RANGE*0.5f)/M_ROOT3)
-static qboolean G_RoomForClassChange( gentity_t *ent, pClass_t class,
- vec3_t newOrigin )
+static qboolean G_RoomForClassChange( gentity_t *ent, class_t class, vec3_t newOrigin )
{
vec3_t fromMins, fromMaxs;
vec3_t toMins, toMaxs;
@@ -1460,7 +1459,7 @@ static qboolean G_RoomForClassChange( gentity_t *ent, pClass_t class,
trace_t tr;
float nudgeHeight;
float maxHorizGrowth;
- pClass_t oldClass = ent->client->ps.stats[ STAT_PCLASS ];
+ class_t oldClass = ent->client->ps.stats[ STAT_CLASS ];
BG_FindBBoxForClass( oldClass, fromMins, fromMaxs, NULL, NULL, NULL );
BG_FindBBoxForClass( class, toMins, toMaxs, NULL, NULL, NULL );
@@ -1520,8 +1519,8 @@ void Cmd_Class_f( gentity_t *ent )
int clientNum;
int i;
vec3_t infestOrigin;
- pClass_t currentClass = ent->client->pers.classSelection;
- pClass_t newClass;
+ class_t currentClass = ent->client->pers.classSelection;
+ class_t newClass;
int entityList[ MAX_GENTITIES ];
vec3_t range = { AS_OVER_RT3, AS_OVER_RT3, AS_OVER_RT3 };
vec3_t mins, maxs;
@@ -1532,11 +1531,11 @@ void Cmd_Class_f( gentity_t *ent )
trap_Argv( 1, s, sizeof( s ) );
newClass = BG_FindClassNumForName( s );
- if( ent->client->sess.sessionTeam == TEAM_SPECTATOR )
+ if( ent->client->sess.spectatorState != SPECTATOR_NOT )
{
if( ent->client->sess.spectatorState == SPECTATOR_FOLLOW )
G_StopFollowing( ent );
- if( ent->client->pers.teamSelection == PTE_ALIENS )
+ if( ent->client->pers.teamSelection == TEAM_ALIENS )
{
if( newClass != PCL_ALIEN_BUILDER0 &&
newClass != PCL_ALIEN_BUILDER0_UPG &&
@@ -1562,10 +1561,10 @@ void Cmd_Class_f( gentity_t *ent )
if( G_PushSpawnQueue( &level.alienSpawnQueue, clientNum ) )
{
ent->client->pers.classSelection = newClass;
- ent->client->ps.stats[ STAT_PCLASS ] = newClass;
+ ent->client->ps.stats[ STAT_CLASS ] = newClass;
}
}
- else if( ent->client->pers.teamSelection == PTE_HUMANS )
+ else if( ent->client->pers.teamSelection == TEAM_HUMANS )
{
//set the item to spawn with
if( !Q_stricmp( s, BG_FindNameForWeapon( WP_MACHINEGUN ) ) &&
@@ -1587,7 +1586,7 @@ void Cmd_Class_f( gentity_t *ent )
if( G_PushSpawnQueue( &level.humanSpawnQueue, clientNum ) )
{
ent->client->pers.classSelection = PCL_HUMAN;
- ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN;
+ ent->client->ps.stats[ STAT_CLASS ] = PCL_HUMAN;
}
}
return;
@@ -1596,7 +1595,7 @@ void Cmd_Class_f( gentity_t *ent )
if( ent->health <= 0 )
return;
- if( ent->client->pers.teamSelection == PTE_ALIENS &&
+ if( ent->client->pers.teamSelection == TEAM_ALIENS &&
!( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) &&
!( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) )
{
@@ -1627,8 +1626,8 @@ void Cmd_Class_f( gentity_t *ent )
{
other = &g_entities[ entityList[ i ] ];
- if( ( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) ||
- ( other->s.eType == ET_BUILDABLE && other->biteam == BIT_HUMANS ) )
+ if( ( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) ||
+ ( other->s.eType == ET_BUILDABLE && other->buildableTeam == TEAM_HUMANS ) )
{
G_TriggerMenu( clientNum, MN_A_TOOCLOSE );
return;
@@ -1642,7 +1641,7 @@ void Cmd_Class_f( gentity_t *ent )
}
//guard against selling the HBUILD weapons exploit
- if( ent->client->sess.sessionTeam != TEAM_SPECTATOR &&
+ if( ent->client->sess.spectatorState == SPECTATOR_NOT &&
( currentClass == PCL_ALIEN_BUILDER0 ||
currentClass == PCL_ALIEN_BUILDER0_UPG ) &&
ent->client->ps.stats[ STAT_MISC ] > 0 )
@@ -1693,7 +1692,7 @@ void Cmd_Class_f( gentity_t *ent )
G_TriggerMenu( clientNum, MN_A_NOEROOM );
}
}
- else if( ent->client->pers.teamSelection == PTE_HUMANS )
+ else if( ent->client->pers.teamSelection == TEAM_HUMANS )
G_TriggerMenu( clientNum, MN_H_DEADTOCLASS );
}
@@ -1734,7 +1733,7 @@ void Cmd_Destroy_f( gentity_t *ent )
if( tr.fraction < 1.0f &&
( traceEnt->s.eType == ET_BUILDABLE ) &&
- ( traceEnt->biteam == ent->client->pers.teamSelection ) &&
+ ( traceEnt->buildableTeam == ent->client->pers.teamSelection ) &&
( ( ent->client->ps.weapon >= WP_ABUILD ) &&
( ent->client->ps.weapon <= WP_HBUILD ) ) )
{
@@ -1755,7 +1754,7 @@ void Cmd_Destroy_f( gentity_t *ent )
// Prevent destruction of the last spawn
if( !g_markDeconstruct.integer && !g_cheats.integer )
{
- if( ent->client->pers.teamSelection == PTE_ALIENS &&
+ if( ent->client->pers.teamSelection == TEAM_ALIENS &&
traceEnt->s.modelindex == BA_A_SPAWN )
{
if( level.numAlienSpawns <= 1 )
@@ -1764,7 +1763,7 @@ void Cmd_Destroy_f( gentity_t *ent )
return;
}
}
- else if( ent->client->pers.teamSelection == PTE_HUMANS &&
+ else if( ent->client->pers.teamSelection == TEAM_HUMANS &&
traceEnt->s.modelindex == BA_H_SPAWN )
{
if( level.numHumanSpawns <= 1 )
@@ -1986,7 +1985,7 @@ void Cmd_Buy_f( gentity_t *ent )
}
// Only humans can buy stuff
- if( BG_FindTeamForWeapon( weapon ) != WUT_HUMANS )
+ if( BG_FindTeamForWeapon( weapon ) != TEAM_HUMANS )
{
trap_SendServerCommand( ent-g_entities, "print \"You can't buy alien items\n\"" );
return;
@@ -2053,7 +2052,7 @@ void Cmd_Buy_f( gentity_t *ent )
}
// Only humans can buy stuff
- if( BG_FindTeamForUpgrade( upgrade ) != WUT_HUMANS )
+ if( BG_FindTeamForUpgrade( upgrade ) != TEAM_HUMANS )
{
trap_SendServerCommand( ent-g_entities, "print \"You can't buy alien items\n\"" );
return;
@@ -2087,7 +2086,7 @@ void Cmd_Buy_f( gentity_t *ent )
return;
}
VectorCopy( newOrigin, ent->s.pos.trBase );
- ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN_BSUIT;
+ ent->client->ps.stats[ STAT_CLASS ] = PCL_HUMAN_BSUIT;
ent->client->ps.eFlags ^= EF_TELEPORT_BIT;
}
@@ -2188,7 +2187,7 @@ void Cmd_Sell_f( gentity_t *ent )
return;
}
VectorCopy( newOrigin, ent->s.pos.trBase );
- ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN;
+ ent->client->ps.stats[ STAT_CLASS ] = PCL_HUMAN;
ent->client->ps.eFlags ^= EF_TELEPORT_BIT;
}
@@ -2252,7 +2251,7 @@ void Cmd_Sell_f( gentity_t *ent )
continue;
}
VectorCopy( newOrigin, ent->s.pos.trBase );
- ent->client->ps.stats[ STAT_PCLASS ] = PCL_HUMAN;
+ ent->client->ps.stats[ STAT_CLASS ] = PCL_HUMAN;
}
BG_RemoveUpgradeFromInventory( i, ent->client->ps.stats );
@@ -2284,7 +2283,7 @@ void Cmd_Build_f( gentity_t *ent )
buildable_t buildable;
float dist;
vec3_t origin;
- pTeam_t team;
+ team_t team;
if( ent->client->pers.denyBuild )
{
@@ -2308,17 +2307,17 @@ void Cmd_Build_f( gentity_t *ent )
return;
}
- team = ent->client->ps.stats[ STAT_PTEAM ];
+ team = ent->client->ps.stats[ STAT_TEAM ];
if( buildable != BA_NONE &&
( ( 1 << ent->client->ps.weapon ) & BG_FindBuildWeaponForBuildable( buildable ) ) &&
!( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) &&
!( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) &&
BG_BuildableIsAllowed( buildable ) &&
- ( ( team == PTE_ALIENS && BG_FindStagesForBuildable( buildable, g_alienStage.integer ) ) ||
- ( team == PTE_HUMANS && BG_FindStagesForBuildable( buildable, g_humanStage.integer ) ) ) )
+ ( ( team == TEAM_ALIENS && BG_FindStagesForBuildable( buildable, g_alienStage.integer ) ) ||
+ ( team == TEAM_HUMANS && BG_FindStagesForBuildable( buildable, g_humanStage.integer ) ) ) )
{
- dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_PCLASS ] );
+ dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_CLASS ] );
//these are the errors displayed when the builder first selects something to use
switch( G_CanBuild( ent, buildable, dist, origin ) )
@@ -2400,8 +2399,7 @@ void G_StopFromFollowing( gentity_t *ent )
for( i = 0; i < level.maxclients; i++ )
{
- if( level.clients[ i ].sess.sessionTeam == TEAM_SPECTATOR &&
- level.clients[ i ].sess.spectatorState == SPECTATOR_FOLLOW &&
+ if( level.clients[ i ].sess.spectatorState == SPECTATOR_FOLLOW &&
level.clients[ i ].sess.spectatorClient == ent->client->ps.clientNum )
{
if( !G_FollowNewClient( &g_entities[ i ], 1 ) )
@@ -2420,11 +2418,11 @@ to free floating spectator mode
*/
void G_StopFollowing( gentity_t *ent )
{
- ent->client->ps.persistant[ PERS_TEAM ] = TEAM_SPECTATOR;
- ent->client->sess.sessionTeam = TEAM_SPECTATOR;
- ent->client->ps.stats[ STAT_PTEAM ] = ent->client->pers.teamSelection;
+ ent->client->sess.spectatorState =
+ ent->client->ps.persistant[ PERS_SPECSTATE ] = SPECTATOR_FREE;
+ ent->client->ps.stats[ STAT_TEAM ] = ent->client->pers.teamSelection;
- if( ent->client->pers.teamSelection == PTE_NONE )
+ if( ent->client->pers.teamSelection == TEAM_NONE )
{
ent->client->sess.spectatorState = SPECTATOR_FREE;
}
@@ -2434,9 +2432,9 @@ void G_StopFollowing( gentity_t *ent )
ent->client->sess.spectatorState = SPECTATOR_LOCKED;
- if( ent->client->pers.teamSelection == PTE_ALIENS )
+ if( ent->client->pers.teamSelection == TEAM_ALIENS )
G_SelectAlienLockSpawnPoint( spawn_origin, spawn_angles );
- else if( ent->client->pers.teamSelection == PTE_HUMANS )
+ else if( ent->client->pers.teamSelection == TEAM_HUMANS )
G_SelectHumanLockSpawnPoint( spawn_origin, spawn_angles );
G_SetOrigin( ent, spawn_origin );
@@ -2469,12 +2467,11 @@ void G_FollowLockView( gentity_t *ent )
int clientNum;
clientNum = ent->client->sess.spectatorClient;
- ent->client->sess.sessionTeam = TEAM_SPECTATOR;
- ent->client->sess.spectatorState = SPECTATOR_FOLLOW;
+ ent->client->sess.spectatorState =
+ ent->client->ps.persistant[ PERS_SPECSTATE ] = SPECTATOR_FOLLOW;
ent->client->ps.clientNum = clientNum;
- ent->client->ps.persistant[ PERS_TEAM ] = TEAM_SPECTATOR;
ent->client->ps.pm_flags &= ~PMF_FOLLOW;
- ent->client->ps.stats[ STAT_PTEAM ] = ent->client->pers.teamSelection;
+ ent->client->ps.stats[ STAT_TEAM ] = ent->client->pers.teamSelection;
ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBING;
ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING;
ent->client->ps.stats[ STAT_VIEWLOCK ] = 0;
@@ -2483,9 +2480,9 @@ void G_FollowLockView( gentity_t *ent )
ent->client->ps.viewangles[ PITCH ] = 0.0f;
// Put the view at the team spectator lock position
- if( level.clients[ clientNum ].pers.teamSelection == PTE_ALIENS )
+ if( level.clients[ clientNum ].pers.teamSelection == TEAM_ALIENS )
G_SelectAlienLockSpawnPoint( spawn_origin, spawn_angles );
- else if( level.clients[ clientNum ].pers.teamSelection == PTE_HUMANS )
+ else if( level.clients[ clientNum ].pers.teamSelection == TEAM_HUMANS )
G_SelectHumanLockSpawnPoint( spawn_origin, spawn_angles );
G_SetOrigin( ent, spawn_origin );
@@ -2513,7 +2510,7 @@ qboolean G_FollowNewClient( gentity_t *ent, int dir )
else if( dir == 0 )
return qtrue;
- if( ent->client->sess.sessionTeam != TEAM_SPECTATOR )
+ if( ent->client->sess.spectatorState == SPECTATOR_NOT )
return qfalse;
// select any if no target exists
@@ -2546,16 +2543,16 @@ qboolean G_FollowNewClient( gentity_t *ent, int dir )
continue;
// can't follow a spectator
- if( level.clients[ clientnum ].pers.teamSelection == PTE_NONE )
+ if( level.clients[ clientnum ].pers.teamSelection == TEAM_NONE )
continue;
// if stickyspec is disabled, can't follow someone in queue either
if( !ent->client->pers.stickySpec &&
- level.clients[ clientnum ].sess.sessionTeam == TEAM_SPECTATOR )
+ level.clients[ clientnum ].sess.spectatorState != SPECTATOR_NOT )
continue;
// can only follow teammates when dead and on a team
- if( ent->client->pers.teamSelection != PTE_NONE &&
+ if( ent->client->pers.teamSelection != TEAM_NONE &&
( level.clients[ clientnum ].pers.teamSelection !=
ent->client->pers.teamSelection ) )
continue;
@@ -2565,7 +2562,7 @@ qboolean G_FollowNewClient( gentity_t *ent, int dir )
ent->client->sess.spectatorState = SPECTATOR_FOLLOW;
// if this client is in the spawn queue, we need to do something special
- if( level.clients[ clientnum ].sess.sessionTeam == TEAM_SPECTATOR )
+ if( level.clients[ clientnum ].sess.spectatorState != SPECTATOR_NOT )
G_FollowLockView( ent );
return qtrue;
@@ -2628,11 +2625,11 @@ void Cmd_Follow_f( gentity_t *ent )
// can't follow another spectator if sticky spec is off
if( !ent->client->pers.stickySpec &&
- level.clients[ i ].sess.sessionTeam == TEAM_SPECTATOR )
+ level.clients[ i ].sess.spectatorState != SPECTATOR_NOT )
return;
// can only follow teammates when dead and on a team
- if( ent->client->pers.teamSelection != PTE_NONE &&
+ if( ent->client->pers.teamSelection != TEAM_NONE &&
( level.clients[ i ].pers.teamSelection !=
ent->client->pers.teamSelection ) )
return;
@@ -2657,8 +2654,6 @@ void Cmd_FollowCycle_f( gentity_t *ent )
dir = -1;
// won't work unless spectating
- if( ent->client->sess.sessionTeam != TEAM_SPECTATOR )
- return;
if( ent->client->sess.spectatorState == SPECTATOR_NOT )
return;
@@ -2692,7 +2687,7 @@ void Cmd_PTRCVerify_f( gentity_t *ent )
if( connection && connection->clientNum == -1 )
{
// valid code
- if( connection->clientTeam != PTE_NONE )
+ if( connection->clientTeam != TEAM_NONE )
trap_SendServerCommand( ent->client->ps.clientNum, "ptrcconfirm" );
// restore mapping
@@ -2978,28 +2973,28 @@ void ClientCommand( int clientNum )
return;
if( cmds[ i ].cmdFlags & CMD_TEAM &&
- ent->client->pers.teamSelection == PTE_NONE )
+ ent->client->pers.teamSelection == TEAM_NONE )
{
G_TriggerMenu( clientNum, MN_CMD_TEAM );
return;
}
if( cmds[ i ].cmdFlags & CMD_SPEC &&
- ent->client->sess.sessionTeam != TEAM_SPECTATOR )
+ ent->client->sess.spectatorState == SPECTATOR_NOT )
{
G_TriggerMenu( clientNum, MN_CMD_SPEC );
return;
}
if( cmds[ i ].cmdFlags & CMD_ALIEN &&
- ent->client->pers.teamSelection != PTE_ALIENS )
+ ent->client->pers.teamSelection != TEAM_ALIENS )
{
G_TriggerMenu( clientNum, MN_CMD_ALIEN );
return;
}
if( cmds[ i ].cmdFlags & CMD_HUMAN &&
- ent->client->pers.teamSelection != PTE_HUMANS )
+ ent->client->pers.teamSelection != TEAM_HUMANS )
{
G_TriggerMenu( clientNum, MN_CMD_HUMAN );
return;
@@ -3007,7 +3002,7 @@ void ClientCommand( int clientNum )
if( cmds[ i ].cmdFlags & CMD_LIVING &&
( ent->client->ps.stats[ STAT_HEALTH ] <= 0 ||
- ent->client->sess.sessionTeam == TEAM_SPECTATOR ) )
+ ent->client->sess.spectatorState != SPECTATOR_NOT ) )
{
G_TriggerMenu( clientNum, MN_CMD_LIVING );
return;