diff options
author | Tim Angus <tim@ngus.net> | 2009-10-03 11:41:24 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:14 +0000 |
commit | 614a658030e59212335611596adb196b93e5b437 (patch) | |
tree | b627256cb9b7f4d8c55490111a149d059da5053d /src | |
parent | ea433462e65a861b7123942151e882954f55f052 (diff) |
* Merge clientSession_t::sessionTeam and clientSession_t::spectatorState
* Remove existing team_t (TEAM_FREE, TEAM_SPECTATOR)
* s/pTeam_t/team_t/;s/buildableTeam_t/team_t/;s/WUTeam_t/team_t/
* s/pClass_t/class_t/
* s/PERS_TEAM/PERS_SPECSTATE/
* s/STAT_PTEAM/STAT_TEAM/;s/STAT_PCLASS/STAT_CLASS/
Diffstat (limited to 'src')
38 files changed, 611 insertions, 698 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 7b20b8b8..ae0ed17e 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -373,7 +373,7 @@ void CG_InitBuildables( void ) else { //file doesn't exist - use default - if( BG_FindTeamForBuildable( i ) == BIT_ALIENS ) + if( BG_FindTeamForBuildable( i ) == TEAM_ALIENS ) cg_buildables[ i ].sounds[ j ].sound = defaultAlienSounds[ j ]; else cg_buildables[ i ].sounds[ j ].sound = defaultHumanSounds[ j ]; @@ -629,14 +629,14 @@ CG_BuildableParticleEffects static void CG_BuildableParticleEffects( centity_t *cent ) { entityState_t *es = ¢->currentState; - buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex ); + team_t team = BG_FindTeamForBuildable( es->modelindex ); int health = es->generic1 & B_HEALTH_MASK; float healthFrac = (float)health / B_HEALTH_MASK; if( !( es->eFlags & EF_B_SPAWNED ) ) return; - if( team == BIT_HUMANS ) + if( team == TEAM_HUMANS ) { if( healthFrac < 0.33f && !CG_IsParticleSystemValid( ¢->buildablePS ) ) { @@ -651,7 +651,7 @@ static void CG_BuildableParticleEffects( centity_t *cent ) else if( healthFrac >= 0.33f && CG_IsParticleSystemValid( ¢->buildablePS ) ) CG_DestroyParticleSystem( ¢->buildablePS ); } - else if( team == BIT_ALIENS ) + else if( team == TEAM_ALIENS ) { if( healthFrac < 0.33f && !CG_IsParticleSystemValid( ¢->buildablePS ) ) { @@ -838,7 +838,7 @@ static void CG_BuildableStatusDisplay( centity_t *cent ) entityState_t *hit; int anim; - if( BG_FindTeamForBuildable( es->modelindex ) == BIT_ALIENS ) + if( BG_FindTeamForBuildable( es->modelindex ) == TEAM_ALIENS ) bs = &cgs.alienBuildStat; else bs = &cgs.humanBuildStat; @@ -916,7 +916,7 @@ static void CG_BuildableStatusDisplay( centity_t *cent ) } // hack to make the kit obscure view if( cg_drawGun.integer && visible && - cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_HUMANS && + cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS && CG_WorldToScreen( origin, &x, &y ) ) { if( x > 450 && y > 290 ) @@ -1188,13 +1188,13 @@ void CG_Buildable( centity_t *cent ) vec3_t surfNormal, xNormal, mins, maxs; vec3_t refNormal = { 0.0f, 0.0f, 1.0f }; float rotAngle; - buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex ); + team_t team = BG_FindTeamForBuildable( es->modelindex ); float scale; int health; float healthScale; //must be before EF_NODRAW check - if( team == BIT_ALIENS ) + if( team == TEAM_ALIENS ) CG_Creep( cent ); // if set to invisible, skip @@ -1256,12 +1256,12 @@ void CG_Buildable( centity_t *cent ) { sfxHandle_t prebuildSound = cgs.media.humanBuildablePrebuild; - if( team == BIT_HUMANS ) + if( team == TEAM_HUMANS ) { ent.customShader = cgs.media.humanSpawningShader; prebuildSound = cgs.media.humanBuildablePrebuild; } - else if( team == BIT_ALIENS ) + else if( team == TEAM_ALIENS ) prebuildSound = cgs.media.alienBuildablePrebuild; trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, prebuildSound ); @@ -1415,12 +1415,12 @@ void CG_Buildable( centity_t *cent ) { if( cent->lastBuildableDamageSoundTime + BUILDABLE_SOUND_PERIOD < cg.time ) { - if( team == BIT_HUMANS ) + if( team == TEAM_HUMANS ) { int i = rand( ) % 4; trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.humanBuildableDamage[ i ] ); } - else if( team == BIT_ALIENS ) + else if( team == TEAM_ALIENS ) trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.alienBuildableDamage ); cent->lastBuildableDamageSoundTime = cg.time; diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index a6302afe..a84f3730 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -316,9 +316,9 @@ static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean p value = ps->persistant[ PERS_CREDIT ]; if( value > -1 ) { - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS ) { - if( !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_PCLASS ], + if( !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_CLASS ], value, cgs.alienStage ) && cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME && ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) & 1 ) @@ -721,7 +721,7 @@ CG_DrawAlienSense */ static void CG_DrawAlienSense( rectDef_t *rect ) { - if( BG_ClassHasAbility( cg.snap->ps.stats[ STAT_PCLASS ], SCA_ALIENSENSE ) ) + if( BG_ClassHasAbility( cg.snap->ps.stats[ STAT_CLASS ], SCA_ALIENSENSE ) ) CG_AlienSense( rect ); } @@ -757,7 +757,7 @@ static void CG_DrawUsableBuildable( rectDef_t *rect, qhandle_t shader, vec4_t co es = &cg_entities[ trace.entityNum ].currentState; if( es->eType == ET_BUILDABLE && BG_FindUsableForBuildable( es->modelindex ) && - cg.predictedPlayerState.stats[ STAT_PTEAM ] == BG_FindTeamForBuildable( es->modelindex ) ) + cg.predictedPlayerState.stats[ STAT_TEAM ] == BG_FindTeamForBuildable( es->modelindex ) ) { //hack to prevent showing the usable buildable when you aren't carrying an energy weapon if( ( es->modelindex == BA_H_REACTOR || es->modelindex == BA_H_REPEATER ) && @@ -872,7 +872,7 @@ static void CG_DrawPlayerHealthCross( rectDef_t *rect, vec4_t ref_color ) shader = cgs.media.healthCross3X; else if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) { - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) shader = cgs.media.healthCross2X; else shader = cgs.media.healthCrossMedkit; @@ -882,7 +882,7 @@ static void CG_DrawPlayerHealthCross( rectDef_t *rect, vec4_t ref_color ) // Pick the alpha value Vector4Copy( ref_color, color ); - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && cg.snap->ps.stats[ STAT_HEALTH ] < 10 ) { color[ 0 ] = 1.0f; @@ -1411,7 +1411,7 @@ static void CG_DrawTeamSpectators( rectDef_t *rect, float scale, int textvalign, CG_DrawTeamLabel ================== */ -static void CG_DrawTeamLabel( rectDef_t *rect, pTeam_t team, float text_x, float text_y, +static void CG_DrawTeamLabel( rectDef_t *rect, team_t team, float text_x, float text_y, vec4_t color, float scale, int textalign, int textvalign, int textStyle ) { char *t; @@ -1423,13 +1423,13 @@ static void CG_DrawTeamLabel( rectDef_t *rect, pTeam_t team, float text_x, float switch( team ) { - case PTE_ALIENS: + case TEAM_ALIENS: t = "Aliens"; if( cg.intermissionStarted ) Com_sprintf( stage, MAX_TOKEN_CHARS, "(Stage %d)", cgs.alienStage + 1 ); break; - case PTE_HUMANS: + case TEAM_HUMANS: t = "Humans"; if( cg.intermissionStarted ) Com_sprintf( stage, MAX_TOKEN_CHARS, "(Stage %d)", cgs.humanStage + 1 ); @@ -1470,10 +1470,10 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, if( cg.intermissionStarted ) return; - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_NONE ) + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_NONE ) return; - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { int kills = ceil( (float)(cgs.alienNextStageThreshold - cgs.alienCredits) / ALIEN_CREDITS_PER_FRAG ); if( kills < 0 ) @@ -1488,7 +1488,7 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d, %d kills for next stage", cgs.alienStage + 1, kills ); } - else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { int credits = cgs.humanNextStageThreshold - cgs.humanCredits; //having credits to next stage constantly increasing feels wrong, so @@ -2114,8 +2114,8 @@ void CG_DrawWeaponIcon( rectDef_t *rect, vec4_t color ) } } - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS && - !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_PCLASS ], + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS && + !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_CLASS ], ps->persistant[ PERS_CREDIT ], cgs.alienStage ) ) { if( cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME ) @@ -2164,7 +2164,7 @@ static void CG_DrawCrosshair( void ) !BG_FindLongRangedForWeapon( weapon ) ) return; - if( ( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) || + if( ( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) || ( cg.snap->ps.stats[ STAT_STATE ] & SS_INFESTING ) || ( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) return; @@ -2203,7 +2203,7 @@ static void CG_ScanForCrosshairEntity( void ) trace_t trace; vec3_t start, end; int content; - pTeam_t team; + team_t team; VectorCopy( cg.refdef.vieworg, start ); VectorMA( start, 131072, cg.refdef.viewaxis[ 0 ], end ); @@ -2221,10 +2221,10 @@ static void CG_ScanForCrosshairEntity( void ) team = cgs.clientinfo[ trace.entityNum ].team; - if( cg.snap->ps.persistant[ PERS_TEAM ] != TEAM_SPECTATOR ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] == SPECTATOR_NOT ) { //only display team names of those on the same team as this player - if( team != cg.snap->ps.stats[ STAT_PTEAM ] ) + if( team != cg.snap->ps.stats[ STAT_TEAM ] ) return; } @@ -2391,10 +2391,10 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, CG_DrawStageReport( &rect, text_x, text_y, color, scale, textalign, textvalign, textStyle ); break; case CG_ALIENS_SCORE_LABEL: - CG_DrawTeamLabel( &rect, PTE_ALIENS, text_x, text_y, color, scale, textalign, textvalign, textStyle ); + CG_DrawTeamLabel( &rect, TEAM_ALIENS, text_x, text_y, color, scale, textalign, textvalign, textStyle ); break; case CG_HUMANS_SCORE_LABEL: - CG_DrawTeamLabel( &rect, PTE_HUMANS, text_x, text_y, color, scale, textalign, textvalign, textStyle ); + CG_DrawTeamLabel( &rect, TEAM_HUMANS, text_x, text_y, color, scale, textalign, textvalign, textStyle ); break; //loading screen @@ -2615,7 +2615,7 @@ static void CG_DrawLighting( void ) //fade to black if stamina is low if( ( cg.snap->ps.stats[ STAT_STAMINA ] < -800 ) && - ( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) ) + ( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) ) { vec4_t black = { 0, 0, 0, 0 }; black[ 3 ] = 1.0 - ( (float)( cg.snap->ps.stats[ STAT_STAMINA ] + 1000 ) / 200.0f ); @@ -2776,9 +2776,9 @@ static void CG_DrawTeamVote( void ) vec4_t white = { 1.0f, 1.0f, 1.0f, 1.0f }; char yeskey[ 32 ], nokey[ 32 ]; - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS ) cs_offset = 0; - else if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + else if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS ) cs_offset = 1; else return; @@ -2984,13 +2984,13 @@ static void CG_Draw2D( void ) defaultMenu = Menus_FindByName( "default_hud" ); - if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) { w = UI_Text_Width( SPECTATOR_STRING, 0.7f, 0 ); UI_Text_Paint( 320 - w / 2, 440, 0.7f, color, SPECTATOR_STRING, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); } else - menu = Menus_FindByName( BG_FindHudNameForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ) ); + menu = Menus_FindByName( BG_FindHudNameForClass( cg.predictedPlayerState.stats[ STAT_CLASS ] ) ); if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_INFESTING ) && !( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) && menu && @@ -3056,7 +3056,7 @@ static void CG_PainBlend( void ) float x, y, w, h; float s1, t1, s2, t2; - if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR || cg.intermissionStarted ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || cg.intermissionStarted ) return; damage = cg.lastHealth - cg.snap->ps.stats[ STAT_HEALTH ]; @@ -3083,9 +3083,9 @@ static void CG_PainBlend( void ) return; } - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) VectorSet( color, 0.43f, 0.8f, 0.37f ); - else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) VectorSet( color, 0.8f, 0.0f, 0.0f ); if( cg.painBlendValue > cg.painBlendTarget ) diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index e4b9fb44..65f728d3 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -474,10 +474,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) clientInfo_t *ci; int steptime; - if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) steptime = 200; else - steptime = BG_FindSteptimeForClass( cg.snap->ps.stats[ STAT_PCLASS ] ); + steptime = BG_FindSteptimeForClass( cg.snap->ps.stats[ STAT_CLASS ] ); es = ¢->currentState; event = es->event & ~EV_EVENT_BITS; @@ -663,7 +663,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) DEBUGNAME( "EV_JUMP" ); trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) ); - if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_PCLASS ], SCA_WALLJUMPER ) ) + if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) { vec3_t surfNormal, refNormal = { 0.0f, 0.0f, 1.0f }; vec3_t rotAxis; @@ -954,7 +954,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_OVERMIND_ATTACK: DEBUGNAME( "EV_OVERMIND_ATTACK" ); - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS ) { trap_S_StartLocalSound( cgs.media.alienOvermindAttack, CHAN_ANNOUNCER ); CG_CenterPrint( "The Overmind is under attack!", 200, GIANTCHAR_WIDTH * 4 ); @@ -963,7 +963,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_OVERMIND_DYING: DEBUGNAME( "EV_OVERMIND_DYING" ); - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS ) { trap_S_StartLocalSound( cgs.media.alienOvermindDying, CHAN_ANNOUNCER ); CG_CenterPrint( "The Overmind is dying!", 200, GIANTCHAR_WIDTH * 4 ); @@ -972,7 +972,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_DCC_ATTACK: DEBUGNAME( "EV_DCC_ATTACK" ); - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS ) { //trap_S_StartLocalSound( cgs.media.humanDCCAttack, CHAN_ANNOUNCER ); CG_CenterPrint( "Our base is under attack!", 200, GIANTCHAR_WIDTH * 4 ); @@ -986,7 +986,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_OVERMIND_SPAWNS: DEBUGNAME( "EV_OVERMIND_SPAWNS" ); - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS ) { trap_S_StartLocalSound( cgs.media.alienOvermindSpawns, CHAN_ANNOUNCER ); CG_CenterPrint( "The Overmind needs spawns!", 200, GIANTCHAR_WIDTH * 4 ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 4f51f934..2aeaf95f 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -723,7 +723,7 @@ typedef struct qboolean infoValid; char name[ MAX_QPATH ]; - pTeam_t team; + team_t team; vec3_t color1; vec3_t color2; @@ -1653,7 +1653,7 @@ void CG_Player( centity_t *cent ); void CG_Corpse( centity_t *cent ); void CG_ResetPlayerEntity( centity_t *cent ); void CG_NewClientInfo( int clientNum ); -void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin ); +void CG_PrecacheClientInfo( class_t class, char *model, char *skin ); sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ); void CG_PlayerDisconnect( vec3_t org ); void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 0ac7896c..10769252 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -954,7 +954,7 @@ void CG_BuildSpectatorString( void ) for( i = 0; i < MAX_CLIENTS; i++ ) { - if( cgs.clientinfo[ i ].infoValid && cgs.clientinfo[ i ].team == PTE_NONE ) + if( cgs.clientinfo[ i ].infoValid && cgs.clientinfo[ i ].team == TEAM_NONE ) Q_strcat( cg.spectatorList, sizeof( cg.spectatorList ), va( "%s " S_COLOR_WHITE, cgs.clientinfo[ i ].name ) ); } @@ -1066,8 +1066,8 @@ int CG_PlayerCount( void ) for( i = 0; i < cg.numScores; i++ ) { - if( cg.scores[ i ].team == PTE_ALIENS || - cg.scores[ i ].team == PTE_HUMANS ) + if( cg.scores[ i ].team == TEAM_ALIENS || + cg.scores[ i ].team == TEAM_HUMANS ) count++; } @@ -1428,7 +1428,7 @@ static int CG_FeederCount( float feederID ) { for( i = 0; i < cg.numScores; i++ ) { - if( cg.scores[ i ].team == PTE_ALIENS ) + if( cg.scores[ i ].team == TEAM_ALIENS ) count++; } } @@ -1436,7 +1436,7 @@ static int CG_FeederCount( float feederID ) { for( i = 0; i < cg.numScores; i++ ) { - if( cg.scores[ i ].team == PTE_HUMANS ) + if( cg.scores[ i ].team == TEAM_HUMANS ) count++; } } @@ -1456,9 +1456,9 @@ void CG_SetScoreSelection( void *p ) for( i = 0; i < cg.numScores; i++ ) { - if( cg.scores[ i ].team == PTE_ALIENS ) + if( cg.scores[ i ].team == TEAM_ALIENS ) alien++; - else if( cg.scores[ i ].team == PTE_HUMANS ) + else if( cg.scores[ i ].team == TEAM_HUMANS ) human++; if( ps->clientNum == cg.scores[ i ].client ) @@ -1472,7 +1472,7 @@ void CG_SetScoreSelection( void *p ) feeder = FEEDER_ALIENTEAM_LIST; i = alien; - if( cg.scores[ cg.selectedScore ].team == PTE_HUMANS ) + if( cg.scores[ cg.selectedScore ].team == TEAM_HUMANS ) { feeder = FEEDER_HUMANTEAM_LIST; i = human; @@ -1515,9 +1515,9 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha *handle = -1; if( feederID == FEEDER_ALIENTEAM_LIST ) - team = PTE_ALIENS; + team = TEAM_ALIENS; else if( feederID == FEEDER_HUMANTEAM_LIST ) - team = PTE_HUMANS; + team = TEAM_HUMANS; info = CG_InfoFromScoreIndex( index, team, &scoreIndex ); sp = &cg.scores[ scoreIndex ]; @@ -1526,7 +1526,7 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha cg.intermissionStarted ) showIcons = qfalse; else if( cg.snap->ps.pm_type == PM_SPECTATOR || cg.snap->ps.pm_flags & PMF_FOLLOW || - team == cg.snap->ps.stats[ STAT_PTEAM ] || cg.intermissionStarted ) + team == cg.snap->ps.stats[ STAT_TEAM ] || cg.intermissionStarted ) showIcons = qtrue; if( info && info->infoValid ) @@ -1544,9 +1544,9 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha case 1: if( showIcons ) { - if( sp->team == PTE_HUMANS && sp->upgrade != UP_NONE ) + if( sp->team == TEAM_HUMANS && sp->upgrade != UP_NONE ) *handle = cg_upgrades[ sp->upgrade ].upgradeIcon; - else if( sp->team == PTE_ALIENS ) + else if( sp->team == TEAM_ALIENS ) { switch( sp->weapon ) { @@ -1602,7 +1602,7 @@ static qhandle_t CG_FeederItemImage( float feederID, int index ) static void CG_FeederSelection( float feederID, int index ) { int i, count; - int team = ( feederID == FEEDER_ALIENTEAM_LIST ) ? PTE_ALIENS : PTE_HUMANS; + int team = ( feederID == FEEDER_ALIENTEAM_LIST ) ? TEAM_ALIENS : TEAM_HUMANS; count = 0; for( i = 0; i < cg.numScores; i++ ) diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 9a7be70b..cbbc0277 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -628,7 +628,7 @@ static void CG_CopyClientInfoModel( clientInfo_t *from, clientInfo_t *to ) CG_GetCorpseNum ====================== */ -static int CG_GetCorpseNum( pClass_t class ) +static int CG_GetCorpseNum( class_t class ) { int i; clientInfo_t *match; @@ -695,7 +695,7 @@ static qboolean CG_ScanForExistingClientInfo( clientInfo_t *ci ) CG_PrecacheClientInfo ====================== */ -void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin ) +void CG_PrecacheClientInfo( class_t class, char *model, char *skin ) { clientInfo_t *ci; clientInfo_t newInfo; @@ -1600,7 +1600,7 @@ Returns the Z component of the surface being shadowed =============== */ #define SHADOW_DISTANCE 128 -static qboolean CG_PlayerShadow( centity_t *cent, float *shadowPlane, pClass_t class ) +static qboolean CG_PlayerShadow( centity_t *cent, float *shadowPlane, class_t class ) { vec3_t end, mins, maxs; trace_t trace; @@ -1667,7 +1667,7 @@ CG_PlayerSplash Draw a mark at the water surface =============== */ -static void CG_PlayerSplash( centity_t *cent, pClass_t class ) +static void CG_PlayerSplash( centity_t *cent, class_t class ) { vec3_t start, end; vec3_t mins, maxs; @@ -1858,7 +1858,7 @@ void CG_Player( centity_t *cent ) qboolean shadow = qfalse; float shadowPlane; entityState_t *es = ¢->currentState; - pClass_t class = ( es->misc >> 8 ) & 0xFF; + class_t class = ( es->misc >> 8 ) & 0xFF; float scale; vec3_t tempAxis[ 3 ], tempAxis2[ 3 ]; vec3_t angles; @@ -2367,16 +2367,16 @@ This is the spurt of blood when a character gets hit */ void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum ) { - pTeam_t team = cgs.clientinfo[ entityNum ].team; + team_t team = cgs.clientinfo[ entityNum ].team; qhandle_t bleedPS; particleSystem_t *ps; if( !cg_blood.integer ) return; - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) bleedPS = cgs.media.alienBleedPS; - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) bleedPS = cgs.media.humanBleedPS; else return; diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 6999e773..ba2d7359 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -248,7 +248,7 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) int reward; // don't play the sounds if the player just changed teams - if( ps->persistant[ PERS_TEAM ] != ops->persistant[ PERS_TEAM ] ) + if( ps->persistant[ PERS_SPECSTATE ] != ops->persistant[ PERS_SPECSTATE ] ) return; // health changes of more than -1 should make pain sounds @@ -301,7 +301,7 @@ void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops ) } if( cg.snap->ps.pm_type != PM_INTERMISSION && - ps->persistant[ PERS_TEAM ] != TEAM_SPECTATOR ) + ps->persistant[ PERS_SPECSTATE ] == SPECTATOR_NOT ) CG_CheckLocalSounds( ps, ops ); // run events @@ -315,7 +315,7 @@ void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops ) } // changed team - if( ps->persistant[ PERS_TEAM ] != ops->persistant[ PERS_TEAM ] ) + if( ps->stats[ STAT_TEAM ] != ops->stats[ STAT_TEAM ] ) { cg.lastHealthCross = 0; cg.chargeMeterAlpha = 0.0f; diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index e167f0f8..5c8ef974 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -587,7 +587,7 @@ void CG_PredictPlayerState( void ) else cg_pmove.tracemask = MASK_PLAYERSOLID; - if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) cg_pmove.tracemask = MASK_DEADSOLID; // spectators can fly through bodies cg_pmove.noFootsteps = 0; diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c index 067ca7fb..e0498b43 100644 --- a/src/cgame/cg_scanner.c +++ b/src/cgame/cg_scanner.c @@ -39,7 +39,7 @@ void CG_UpdateEntityPositions( void ) centity_t *cent = NULL; int i; - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS ) { if( entityPositions.lastUpdateTime + HUMAN_SCANNER_UPDATE_PERIOD > cg.time ) return; @@ -61,7 +61,7 @@ void CG_UpdateEntityPositions( void ) if( cent->currentState.eType == ET_BUILDABLE ) { // add to list of item positions (for creep) - if( cent->currentState.modelindex2 == BIT_ALIENS ) + if( cent->currentState.modelindex2 == TEAM_ALIENS ) { VectorCopy( cent->lerpOrigin, entityPositions.alienBuildablePos[ entityPositions.numAlienBuildables ] ); @@ -71,7 +71,7 @@ void CG_UpdateEntityPositions( void ) if( entityPositions.numAlienBuildables < MAX_GENTITIES ) entityPositions.numAlienBuildables++; } - else if( cent->currentState.modelindex2 == BIT_HUMANS ) + else if( cent->currentState.modelindex2 == TEAM_HUMANS ) { VectorCopy( cent->lerpOrigin, entityPositions.humanBuildablePos[ entityPositions.numHumanBuildables ] ); @@ -84,7 +84,7 @@ void CG_UpdateEntityPositions( void ) { int team = cent->currentState.misc & 0x00FF; - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { VectorCopy( cent->lerpOrigin, entityPositions.alienClientPos[ entityPositions.numAlienClients ] ); @@ -92,7 +92,7 @@ void CG_UpdateEntityPositions( void ) if( entityPositions.numAlienClients < MAX_CLIENTS ) entityPositions.numAlienClients++; } - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) { VectorCopy( cent->lerpOrigin, entityPositions.humanClientPos[ entityPositions.numHumanClients ] ); diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index 8f860072..813820f3 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -221,7 +221,7 @@ CG_AnnounceAlienStageTransistion */ static void CG_AnnounceAlienStageTransistion( stage_t from, stage_t to ) { - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] != PTE_ALIENS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] != TEAM_ALIENS ) return; trap_S_StartLocalSound( cgs.media.alienStageTransition, CHAN_ANNOUNCER ); @@ -235,7 +235,7 @@ CG_AnnounceHumanStageTransistion */ static void CG_AnnounceHumanStageTransistion( stage_t from, stage_t to ) { - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( cg.predictedPlayerState.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; trap_S_StartLocalSound( cgs.media.humanStageTransition, CHAN_ANNOUNCER ); @@ -459,12 +459,12 @@ void CG_Menu( int menu, int arg ) const char *dialog; dialogType_t type = 0; // controls which cg_disable var will switch it off - switch( cg.snap->ps.stats[ STAT_PTEAM ] ) + switch( cg.snap->ps.stats[ STAT_TEAM ] ) { - case PTE_ALIENS: + case TEAM_ALIENS: dialog = "menu tremulous_alien_dialog\n"; break; - case PTE_HUMANS: + case TEAM_HUMANS: dialog = "menu tremulous_human_dialog\n"; break; default: @@ -832,7 +832,7 @@ void CG_Menu( int menu, int arg ) break; case MN_A_INFEST: - trap_Cvar_Set( "ui_currentClass", va( "%d %d", cg.snap->ps.stats[ STAT_PCLASS ], + trap_Cvar_Set( "ui_currentClass", va( "%d %d", cg.snap->ps.stats[ STAT_CLASS ], cg.snap->ps.persistant[ PERS_CREDIT ] ) ); cmd = "menu tremulous_alienupgrade\n"; type = DT_INTERACTIVE; @@ -959,9 +959,9 @@ static void CG_ServerCommand( void ) Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT ); if( Q_stricmpn( text, "[skipnotify]", 12 ) ) { - if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) trap_S_StartLocalSound( cgs.media.alienTalkSound, CHAN_LOCAL_SOUND ); - else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) trap_S_StartLocalSound( cgs.media.humanTalkSound, CHAN_LOCAL_SOUND ); else trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c index 0375b3e0..03aaa59e 100644 --- a/src/cgame/cg_tutorial.c +++ b/src/cgame/cg_tutorial.c @@ -162,7 +162,7 @@ static entityState_t *CG_BuildableInRange( playerState_t *ps, float *healthFract } if( es->eType == ET_BUILDABLE && - ps->stats[ STAT_PTEAM ] == BG_FindTeamForBuildable( es->modelindex ) ) + ps->stats[ STAT_TEAM ] == BG_FindTeamForBuildable( es->modelindex ) ) return es; else return NULL; @@ -222,7 +222,7 @@ static void CG_AlienBuilderText( char *text, playerState_t *ps ) } } - if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG ) + if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ) { if( ( ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) == BA_NONE ) { @@ -270,7 +270,7 @@ static void CG_AlienLevel1Text( char *text, playerState_t *ps ) va( "Press %s to swipe\n", CG_KeyNameForCommand( "+attack" ) ) ); - if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_LEVEL1_UPG ) + if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL1_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to spray poisonous gas\n", @@ -293,7 +293,7 @@ static void CG_AlienLevel2Text( char *text, playerState_t *ps ) va( "Press %s to bite\n", CG_KeyNameForCommand( "+attack" ) ) ); - if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_LEVEL2_UPG ) + if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL2_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to invoke an electrical attack\n", @@ -316,7 +316,7 @@ static void CG_AlienLevel3Text( char *text, playerState_t *ps ) va( "Press %s to bite\n", CG_KeyNameForCommand( "+attack" ) ) ); - if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_LEVEL3_UPG ) + if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL3_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to launch a projectile\n", @@ -555,7 +555,7 @@ CG_SpectatorText */ static void CG_SpectatorText( char *text, playerState_t *ps ) { - if( cgs.clientinfo[ cg.clientNum ].team != PTE_NONE ) + if( cgs.clientinfo[ cg.clientNum ].team != TEAM_NONE ) { if( ps->pm_flags & PMF_QUEUED ) Q_strcat( text, MAX_TUTORIAL_TEXT, @@ -613,14 +613,14 @@ const char *CG_TutorialText( void ) if( !cg.intermissionStarted && !cg.demoPlayback ) { - if( ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR || + if( ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || ps->pm_flags & PMF_FOLLOW ) { CG_SpectatorText( text, ps ); } else if( ps->stats[ STAT_HEALTH ] > 0 ) { - switch( ps->stats[ STAT_PCLASS ] ) + switch( ps->stats[ STAT_CLASS ] ) { case PCL_ALIEN_BUILDER0: case PCL_ALIEN_BUILDER0_UPG: @@ -659,7 +659,7 @@ const char *CG_TutorialText( void ) break; } - if( ps->stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( ps->stats[ STAT_TEAM ] == TEAM_ALIENS ) { entityState_t *es = CG_BuildableInRange( ps, NULL ); @@ -671,14 +671,14 @@ const char *CG_TutorialText( void ) } else if( es && es->modelindex == BA_A_HOVEL && ( es->eFlags & EF_B_SPAWNED ) && - ( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 || - ps->stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG ) ) + ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0 || + ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to enter the hovel\n", CG_KeyNameForCommand( "+button7" ) ) ); } - else if( BG_AlienCanEvolve( ps->stats[ STAT_PCLASS ], + else if( BG_AlienCanEvolve( ps->stats[ STAT_CLASS ], ps->persistant[ PERS_CREDIT ], cgs.alienStage ) ) { diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index f18773c0..15b9bc06 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -353,7 +353,7 @@ static void CG_StepOffset( void ) BG_GetClientNormal( ps, normal ); - steptime = BG_FindSteptimeForClass( ps->stats[ STAT_PCLASS ] ); + steptime = BG_FindSteptimeForClass( ps->stats[ STAT_CLASS ] ); // smooth out stair climbing timeDelta = cg.time - cg.stepTime; @@ -457,10 +457,10 @@ static void CG_OffsetFirstPersonView( void ) // add angles based on bob // bob amount is class dependant - if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) bob2 = 0.0f; else - bob2 = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ); + bob2 = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_CLASS ] ); #define LEVEL4_FEEDBACK 10.0f @@ -596,7 +596,7 @@ static void CG_OffsetFirstPersonView( void ) } // this *feels* more realisitic for humans - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS && ( cg.predictedPlayerState.pm_type == PM_NORMAL || cg.predictedPlayerState.pm_type == PM_JETPACK ) ) { @@ -691,7 +691,7 @@ static int CG_CalcFov( void ) trap_GetUserCmd( cmdNum, &cmd ); if( cg.predictedPlayerState.pm_type == PM_INTERMISSION || - ( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) ) + ( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) ) { // if in intermission, use a fixed value fov_x = 90; @@ -699,7 +699,7 @@ static int CG_CalcFov( void ) else { // don't lock the fov globally - we need to be able to change it - attribFov = BG_FindFovForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ); + attribFov = BG_FindFovForClass( cg.predictedPlayerState.stats[ STAT_CLASS ] ); fov_x = attribFov; if ( fov_x < 1 ) @@ -708,7 +708,7 @@ static int CG_CalcFov( void ) fov_x = 160; if( cg.spawnTime > ( cg.time - FOVWARPTIME ) && - BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_PCLASS ], SCA_FOVWARPS ) ) + BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_FOVWARPS ) ) { float temp, temp2; @@ -1079,16 +1079,16 @@ static int CG_CalcViewValues( void ) VectorCopy( ps->origin, cg.refdef.vieworg ); - if( BG_ClassHasAbility( ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) ) + if( BG_ClassHasAbility( ps->stats[ STAT_CLASS ], SCA_WALLCLIMBER ) ) CG_smoothWWTransitions( ps, ps->viewangles, cg.refdefViewAngles ); - else if( BG_ClassHasAbility( ps->stats[ STAT_PCLASS ], SCA_WALLJUMPER ) ) + else if( BG_ClassHasAbility( ps->stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) CG_smoothWJTransitions( ps, ps->viewangles, cg.refdefViewAngles ); else VectorCopy( ps->viewangles, cg.refdefViewAngles ); //clumsy logic, but it needs to be this way round because the CS propogation //delay screws things up otherwise - if( !BG_ClassHasAbility( ps->stats[ STAT_PCLASS ], SCA_WALLJUMPER ) ) + if( !BG_ClassHasAbility( ps->stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) { if( !( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) VectorSet( cg.lastNormal, 0.0f, 0.0f, 1.0f ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 0f72a378..3b0d6f2f 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -868,7 +868,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) // gun angles from bobbing // bob amount is class dependant - bob = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ); + bob = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_CLASS ] ); if( bob != 0 ) { @@ -1022,7 +1022,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent // Lucifer cannon charge warning beep if( weaponNum == WP_LUCIFER_CANNON && ( cent->currentState.eFlags & EF_WARN_CHARGE ) && - cg.snap->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + cg.snap->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) { trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, ps ? cgs.media.lCannonWarningSound : @@ -1163,7 +1163,7 @@ void CG_AddViewWeapon( playerState_t *ps ) wi = &cg_weapons[ weapon ]; cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum]; - if( ( ps->persistant[PERS_TEAM] == TEAM_SPECTATOR ) || + if( ( ps->persistant[PERS_SPECSTATE] != SPECTATOR_NOT ) || ( ps->stats[ STAT_STATE ] & SS_INFESTING ) || ( ps->stats[ STAT_STATE ] & SS_HOVELING ) ) return; diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 5b06eb5f..8f03f098 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -56,7 +56,7 @@ buildableAttributes_t bg_buildableList[ ] = ASPAWN_SPLASHDAMAGE, //int splashDamage; ASPAWN_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -96,7 +96,7 @@ buildableAttributes_t bg_buildableList[ ] = BARRICADE_SPLASHDAMAGE,//int splashDamage; BARRICADE_SPLASHRADIUS,//int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -137,7 +137,7 @@ buildableAttributes_t bg_buildableList[ ] = BOOSTER_SPLASHDAMAGE, //int splashDamage; BOOSTER_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -177,7 +177,7 @@ buildableAttributes_t bg_buildableList[ ] = ACIDTUBE_SPLASHDAMAGE, //int splashDamage; ACIDTUBE_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 200, //int nextthink; @@ -216,7 +216,7 @@ buildableAttributes_t bg_buildableList[ ] = HIVE_SPLASHDAMAGE, //int splashDamage; HIVE_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 500, //int nextthink; @@ -256,7 +256,7 @@ buildableAttributes_t bg_buildableList[ ] = TRAPPER_SPLASHDAMAGE, //int splashDamage; TRAPPER_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -296,7 +296,7 @@ buildableAttributes_t bg_buildableList[ ] = OVERMIND_SPLASHDAMAGE, //int splashDamage; OVERMIND_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; OVERMIND_ATTACK_REPEAT,//int nextthink; @@ -336,7 +336,7 @@ buildableAttributes_t bg_buildableList[ ] = HOVEL_SPLASHDAMAGE, //int splashDamage; HOVEL_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; - BIT_ALIENS, //int team; + TEAM_ALIENS, //int team; ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; @@ -376,7 +376,7 @@ buildableAttributes_t bg_buildableList[ ] = HSPAWN_SPLASHDAMAGE, //int splashDamage; HSPAWN_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -417,7 +417,7 @@ buildableAttributes_t bg_buildableList[ ] = MEDISTAT_SPLASHDAMAGE, //int splashDamage; MEDISTAT_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -459,7 +459,7 @@ buildableAttributes_t bg_buildableList[ ] = MGTURRET_SPLASHDAMAGE, //int splashDamage; MGTURRET_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 50, //int nextthink; @@ -499,7 +499,7 @@ buildableAttributes_t bg_buildableList[ ] = TESLAGEN_SPLASHDAMAGE, //int splashDamage; TESLAGEN_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; @@ -539,7 +539,7 @@ buildableAttributes_t bg_buildableList[ ] = DC_SPLASHDAMAGE, //int splashDamage; DC_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -579,7 +579,7 @@ buildableAttributes_t bg_buildableList[ ] = ARMOURY_SPLASHDAMAGE, //int splashDamage; ARMOURY_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -619,7 +619,7 @@ buildableAttributes_t bg_buildableList[ ] = REACTOR_SPLASHDAMAGE, //int splashDamage; REACTOR_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; REACTOR_ATTACK_DCC_REPEAT, //int nextthink; @@ -659,7 +659,7 @@ buildableAttributes_t bg_buildableList[ ] = REPEATER_SPLASHDAMAGE, //int splashDamage; REPEATER_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; - BIT_HUMANS, //int team; + TEAM_HUMANS, //int team; ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; @@ -1123,7 +1123,7 @@ int BG_FindTeamForBuildable( int bclass ) } } - return BIT_NONE; + return TEAM_NONE; } /* @@ -3235,7 +3235,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_MACHINEGUN, //int weaponNum; @@ -3261,7 +3261,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_SHOTGUN, //int weaponNum; @@ -3288,7 +3288,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_FLAMER, //int weaponNum; @@ -3315,7 +3315,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_CHAINGUN, //int weaponNum; @@ -3342,7 +3342,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_MASS_DRIVER, //int weaponNum; @@ -3370,7 +3370,7 @@ weaponAttributes_t bg_weapons[ ] = 20.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_PULSE_RIFLE, //int weaponNum; @@ -3395,7 +3395,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_LUCIFER_CANNON, //int weaponNum; @@ -3422,7 +3422,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_LAS_GUN, //int weaponNum; @@ -3448,7 +3448,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_PAIN_SAW, //int weaponNum; @@ -3475,7 +3475,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_GRENADE, //int weaponNum; @@ -3500,7 +3500,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_HBUILD, //int weaponNum; @@ -3527,7 +3527,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_ABUILD, //int weaponNum; @@ -3552,7 +3552,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ABUILD2, //int weaponNum; @@ -3577,7 +3577,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL0, //int weaponNum; @@ -3602,7 +3602,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL1, //int weaponNum; @@ -3627,7 +3627,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL1_UPG, //int weaponNum; @@ -3652,7 +3652,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL2, //int weaponNum; @@ -3677,7 +3677,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL2_UPG, //int weaponNum; @@ -3702,7 +3702,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL3, //int weaponNum; @@ -3727,7 +3727,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL3_UPG, //int weaponNum; @@ -3752,7 +3752,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_ALEVEL4, //int weaponNum; @@ -3777,7 +3777,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_LOCKBLOB_LAUNCHER, //int weaponNum; @@ -3802,7 +3802,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_HIVE, //int weaponNum; @@ -3827,7 +3827,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_ALIENS //WUTeam_t team; + TEAM_ALIENS //team_t team; }, { WP_MGTURRET, //int weaponNum; @@ -3852,7 +3852,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { WP_TESLAGEN, //int weaponNum; @@ -3877,7 +3877,7 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; } }; @@ -4305,7 +4305,7 @@ qboolean BG_FindLongRangedForWeapon( int weapon ) BG_FindTeamForWeapon ============== */ -WUTeam_t BG_FindTeamForWeapon( int weapon ) +team_t BG_FindTeamForWeapon( int weapon ) { int i; @@ -4317,7 +4317,7 @@ WUTeam_t BG_FindTeamForWeapon( int weapon ) } } - return WUT_NONE; + return TEAM_NONE; } //////////////////////////////////////////////////////////////////////////////// @@ -4336,7 +4336,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_larmour", qtrue, //qboolean purchasable qfalse, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_HELMET, //int upgradeNum; @@ -4351,7 +4351,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_helmet", qtrue, //qboolean purchasable qfalse, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_MEDKIT, //int upgradeNum; @@ -4364,7 +4364,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_atoxin", qfalse, //qboolean purchasable qtrue, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_BATTPACK, //int upgradeNum; @@ -4378,7 +4378,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_battpack", qtrue, //qboolean purchasable qfalse, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_JETPACK, //int upgradeNum; @@ -4393,7 +4393,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_jetpack", qtrue, //qboolean purchasable qtrue, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_BATTLESUIT, //int upgradeNum; @@ -4408,7 +4408,7 @@ upgradeAttributes_t bg_upgrades[ ] = "icons/iconu_bsuit", qtrue, //qboolean purchasable qfalse, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_GRENADE, //int upgradeNum; @@ -4422,7 +4422,7 @@ upgradeAttributes_t bg_upgrades[ ] = 0, qtrue, //qboolean purchasable qtrue, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; }, { UP_AMMO, //int upgradeNum; @@ -4435,7 +4435,7 @@ upgradeAttributes_t bg_upgrades[ ] = 0, qtrue, //qboolean purchasable qfalse, //qboolean usable - WUT_HUMANS //WUTeam_t team; + TEAM_HUMANS //team_t team; } }; @@ -4640,7 +4640,7 @@ qboolean BG_FindUsableForUpgrade( int upgrade ) BG_FindTeamForUpgrade ============== */ -WUTeam_t BG_FindTeamForUpgrade( int upgrade ) +team_t BG_FindTeamForUpgrade( int upgrade ) { int i; @@ -4652,7 +4652,7 @@ WUTeam_t BG_FindTeamForUpgrade( int upgrade ) } } - return WUT_NONE; + return TEAM_NONE; } //////////////////////////////////////////////////////////////////////////////// @@ -4918,7 +4918,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean if( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR || ps->pm_type == PM_FREEZE ) s->eType = ET_INVISIBLE; - else if( ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + else if( ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) s->eType = ET_INVISIBLE; else s->eType = ET_PLAYER; @@ -4994,7 +4994,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean } // use misc field to store team/class info: - s->misc = ps->stats[ STAT_PTEAM ] | ( ps->stats[ STAT_PCLASS ] << 8 ); + s->misc = ps->stats[ STAT_TEAM ] | ( ps->stats[ STAT_CLASS ] << 8 ); // have to get the surfNormal through somehow... VectorCopy( ps->grapplePoint, s->angles2 ); @@ -5025,7 +5025,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s if( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR || ps->pm_type == PM_FREEZE ) s->eType = ET_INVISIBLE; - else if( ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + else if( ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) s->eType = ET_INVISIBLE; else s->eType = ET_PLAYER; @@ -5106,7 +5106,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s } // use misc field to store team/class info: - s->misc = ps->stats[ STAT_PTEAM ] | ( ps->stats[ STAT_PCLASS ] << 8 ); + s->misc = ps->stats[ STAT_TEAM ] | ( ps->stats[ STAT_CLASS ] << 8 ); // have to get the surfNormal through somehow... VectorCopy( ps->grapplePoint, s->angles2 ); @@ -5364,7 +5364,7 @@ void BG_PositionBuildableRelativeToPlayer( const playerState_t *ps, VectorCopy( ps->viewangles, angles ); VectorCopy( ps->origin, playerOrigin ); - buildDist = BG_FindBuildDistForClass( ps->stats[ STAT_PCLASS ] ); + buildDist = BG_FindBuildDistForClass( ps->stats[ STAT_CLASS ] ); AngleVectors( angles, forward, NULL, NULL ); ProjectPointOnPlane( forward, forward, playerNormal ); @@ -5398,10 +5398,10 @@ int BG_GetValueOfPlayer( playerState_t *ps ) { int i, worth = 0; - worth = BG_FindValueOfClass( ps->stats[ STAT_PCLASS] ); + worth = BG_FindValueOfClass( ps->stats[ STAT_CLASS] ); // Humans have worth from their equipment as well - if( ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( ps->stats[ STAT_TEAM ] == TEAM_HUMANS ) { for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) if( BG_InventoryContainsUpgrade( i, ps->stats ) ) @@ -5594,7 +5594,7 @@ void BG_ParseCSVEquipmentList( const char *string, weapon_t *weapons, int weapon BG_ParseCSVClassList =============== */ -void BG_ParseCSVClassList( const char *string, pClass_t *classes, int classesSize ) +void BG_ParseCSVClassList( const char *string, class_t *classes, int classesSize ) { char buffer[ MAX_STRING_CHARS ]; int i = 0; @@ -5692,7 +5692,7 @@ void BG_ParseCSVBuildableList( const char *string, buildable_t *buildables, int typedef struct gameElements_s { buildable_t buildables[ BA_NUM_BUILDABLES ]; - pClass_t classes[ PCL_NUM_CLASSES ]; + class_t classes[ PCL_NUM_CLASSES ]; weapon_t weapons[ WP_NUM_WEAPONS ]; upgrade_t upgrades[ UP_NUM_UPGRADES ]; } gameElements_t; @@ -5771,7 +5771,7 @@ qboolean BG_UpgradeIsAllowed( upgrade_t upgrade ) BG_ClassIsAllowed ============ */ -qboolean BG_ClassIsAllowed( pClass_t class ) +qboolean BG_ClassIsAllowed( class_t class ) { int i; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 64b6a01f..0d493858 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -286,8 +286,8 @@ static void PM_Friction( void ) // if getting knocked back, no friction if( !( pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) ) { - float stopSpeed = BG_FindStopSpeedForClass( pm->ps->stats[ STAT_PCLASS ] ); - float friction = BG_FindFrictionForClass( pm->ps->stats[ STAT_PCLASS ] ); + float stopSpeed = BG_FindStopSpeedForClass( pm->ps->stats[ STAT_CLASS ] ); + float friction = BG_FindFrictionForClass( pm->ps->stats[ STAT_CLASS ] ); // when landing a dodge, extra friction if( pm->ps->pm_flags & PMF_TIME_LAND ) @@ -386,7 +386,7 @@ static float PM_CmdScale( usercmd_t *cmd ) float scale; float modifier = 1.0f; - if( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS && pm->ps->pm_type == PM_NORMAL ) + if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS && pm->ps->pm_type == PM_NORMAL ) { if( pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST ) modifier *= HUMAN_SPRINT_MODIFIER; @@ -449,7 +449,7 @@ static float PM_CmdScale( usercmd_t *cmd ) if( pm->ps->pm_type != PM_SPECTATOR && pm->ps->pm_type != PM_NOCLIP ) { - if( BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ) == 0.0f ) + if( BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_CLASS ] ) == 0.0f ) cmd->upmove = 0; //prevent speed distortions for non ducking classes @@ -675,7 +675,7 @@ static qboolean PM_CheckWallJump( void ) VectorMA( dir, upFraction, refNormal, dir ); VectorNormalize( dir ); - VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ), + VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_CLASS ] ), dir, pm->ps->velocity ); //for a long run of wall jumps the velocity can get pretty large, this caps it @@ -713,10 +713,10 @@ static qboolean PM_CheckJump( void ) { vec3_t normal; - if( BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ) == 0.0f ) + if( BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_CLASS ] ) == 0.0f ) return qfalse; - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLJUMPER ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) return PM_CheckWallJump( ); //can't jump and pounce at the same time @@ -730,7 +730,7 @@ static qboolean PM_CheckJump( void ) pm->ps->stats[ STAT_MISC ] > 0 ) return qfalse; - if( ( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) && + if( ( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS ) && ( pm->ps->stats[ STAT_STAMINA ] < 0 ) ) return qfalse; @@ -762,7 +762,7 @@ static qboolean PM_CheckJump( void ) pm->ps->pm_flags |= PMF_JUMP_HELD; // take some stamina off - if( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS ) pm->ps->stats[ STAT_STAMINA ] -= STAMINA_JUMP_TAKE; pm->ps->groundEntityNum = ENTITYNUM_NONE; @@ -770,7 +770,7 @@ static qboolean PM_CheckJump( void ) // jump away from wall BG_GetClientNormal( pm->ps, normal ); - VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ), + VectorMA( pm->ps->velocity, BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_CLASS ] ), normal, pm->ps->velocity ); PM_AddEvent( EV_JUMP ); @@ -856,7 +856,7 @@ static qboolean PM_CheckDodge( void ) float jump; int i; - if( pm->ps->stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( pm->ps->stats[ STAT_TEAM ] != TEAM_HUMANS ) return qfalse; // Landed a dodge @@ -903,7 +903,7 @@ static qboolean PM_CheckDodge( void ) forward[ 2 ] = 0.0f; // Dodge magnitude is based on the jump magnitude scaled by the modifiers - jump = BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_PCLASS ] ); + jump = BG_FindJumpMagnitudeForClass( pm->ps->stats[ STAT_CLASS ] ); if( pm->cmd.rightmove && pm->cmd.forwardmove ) jump *= ( 0.5f * M_SQRT2 ); @@ -1183,7 +1183,7 @@ static void PM_AirMove( void ) // not on ground, so little effect on velocity PM_Accelerate( wishdir, wishspeed, - BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ) ); + BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_CLASS ] ) ); // we may have a ground plane that is very steep, even // though we don't have a groundentity @@ -1281,9 +1281,9 @@ static void PM_ClimbMove( void ) // when a player gets hit, they temporarily lose // full control, which allows them to be moved a bit if( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) - accelerate = BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); + accelerate = BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_CLASS ] ); else - accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); + accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_CLASS ] ); PM_Accelerate( wishdir, wishspeed, accelerate ); @@ -1399,9 +1399,9 @@ static void PM_WalkMove( void ) // when a player gets hit, they temporarily lose // full control, which allows them to be moved a bit if( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) - accelerate = BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); + accelerate = BG_FindAirAccelerationForClass( pm->ps->stats[ STAT_CLASS ] ); else - accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); + accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_CLASS ] ); PM_Accelerate( wishdir, wishspeed, accelerate ); @@ -1494,7 +1494,7 @@ static void PM_CheckLadder( void ) trace_t trace; //test if class can use ladders - if( !BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_CANUSELADDERS ) ) + if( !BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_CANUSELADDERS ) ) { pml.ladder = qfalse; return; @@ -1825,7 +1825,7 @@ static void PM_GroundTraceMissed( void ) } } - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_TAKESFALLDAMAGE ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_TAKESFALLDAMAGE ) ) { if( pm->ps->velocity[ 2 ] < FALLING_THRESHOLD && pml.previous_velocity[ 2 ] >= FALLING_THRESHOLD ) PM_AddEvent( EV_FALLING ); @@ -2138,7 +2138,7 @@ static void PM_GroundTrace( void ) vec3_t refNormal = { 0.0f, 0.0f, 1.0f }; trace_t trace; - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_WALLCLIMBER ) ) { if( pm->ps->persistant[ PERS_STATE ] & PS_WALLCLIMBINGTOGGLE ) { @@ -2236,7 +2236,7 @@ static void PM_GroundTrace( void ) pml.groundPlane = qfalse; pml.walking = qfalse; - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLJUMPER ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) { ProjectPointOnPlane( movedir, pml.forward, refNormal ); VectorNormalize( movedir ); @@ -2337,7 +2337,7 @@ static void PM_GroundTrace( void ) // communicate the fall velocity to the server pm->pmext->fallVelocity = pml.previous_velocity[ 2 ]; - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_TAKESFALLDAMAGE ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_TAKESFALLDAMAGE ) ) PM_CrashLand( ); } @@ -2410,10 +2410,10 @@ static void PM_CheckDuck (void) vec3_t PCmins, PCmaxs, PCcmaxs; int PCvh, PCcvh; - BG_FindBBoxForClass( pm->ps->stats[ STAT_PCLASS ], PCmins, PCmaxs, PCcmaxs, NULL, NULL ); - BG_FindViewheightForClass( pm->ps->stats[ STAT_PCLASS ], &PCvh, &PCcvh ); + BG_FindBBoxForClass( pm->ps->stats[ STAT_CLASS ], PCmins, PCmaxs, PCcmaxs, NULL, NULL ); + BG_FindViewheightForClass( pm->ps->stats[ STAT_CLASS ], &PCvh, &PCcvh ); - if( pm->ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) PCcvh = PCvh; pm->mins[ 0 ] = PCmins[ 0 ]; @@ -2484,7 +2484,7 @@ static void PM_Footsteps( void ) // calculate speed and cycle to be used for // all cyclic walking effects // - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) && ( pml.groundPlane ) ) + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_WALLCLIMBER ) && ( pml.groundPlane ) ) { // FIXME: yes yes i know this is wrong pm->xyspeed = sqrt( pm->ps->velocity[ 0 ] * pm->ps->velocity[ 0 ] @@ -2644,7 +2644,7 @@ static void PM_Footsteps( void ) } } - bobmove *= BG_FindBobCycleForClass( pm->ps->stats[ STAT_PCLASS ] ); + bobmove *= BG_FindBobCycleForClass( pm->ps->stats[ STAT_CLASS ] ); if( pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST ) bobmove *= HUMAN_SPRINT_MODIFIER; @@ -2818,7 +2818,7 @@ static void PM_Weapon( void ) qboolean attack3 = qfalse; // Ignore weapons in some cases - if( pm->ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR || + if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || ( pm->ps->stats[ STAT_STATE ] & ( SS_INFESTING | SS_HOVELING ) ) ) return; @@ -3704,7 +3704,7 @@ void PmoveSingle( pmove_t *pmove ) PM_LadderMove( ); else if( pml.walking ) { - if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) && + if( BG_ClassHasAbility( pm->ps->stats[ STAT_CLASS ], SCA_WALLCLIMBER ) && ( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) PM_ClimbMove( ); // walking on any surface else diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 57a76f79..cdfe2467 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -212,8 +212,8 @@ typedef enum STAT_WEAPONS, // 16 bit fields STAT_WEAPONS2, // another 16 bits to push the max weapon count up STAT_MAX_HEALTH, // health / armor limit, changable by handicap - STAT_PCLASS, // player class (for aliens AND humans) - STAT_PTEAM, // player team + STAT_CLASS, // player class (for aliens AND humans) + STAT_TEAM, // player team STAT_STAMINA, // stamina (human only) STAT_STATE, // client states e.g. wall climbing STAT_MISC, // for uh...misc stuff (pounce, trample, lcannon) @@ -259,7 +259,7 @@ typedef enum PERS_SCORE, // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!! PERS_HITS, // total points damage inflicted so damage beeps can sound on change PERS_SPAWNS, // how many spawns your team has - PERS_TEAM, + PERS_SPECSTATE, PERS_SPAWN_COUNT, // incremented every respawn PERS_ATTACKER, // clientnum of last damage inflicter PERS_KILLED, // count of the number of times you died @@ -379,16 +379,6 @@ typedef enum UP_NUM_UPGRADES } upgrade_t; -typedef enum -{ - WUT_NONE, - - WUT_ALIENS, - WUT_HUMANS, - - WUT_NUM_TEAMS -} WUTeam_t; - // bitmasks for upgrade slots #define SLOT_NONE 0x00000000 #define SLOT_HEAD 0x00000001 @@ -429,16 +419,6 @@ typedef enum BA_NUM_BUILDABLES } buildable_t; -typedef enum -{ - BIT_NONE, - - BIT_ALIENS, - BIT_HUMANS, - - BIT_NUM_TEAMS -} buildableTeam_t; - #define B_HEALTH_BITS 12 #define B_HEALTH_MASK ((1<<B_HEALTH_BITS)-1) @@ -808,15 +788,6 @@ typedef struct animation_s #define ANIM_TOGGLEBIT 0x80 #define ANIM_FORCEBIT 0x40 - -typedef enum -{ - TEAM_FREE, - TEAM_SPECTATOR, - - TEAM_NUM_TEAMS -} team_t; - // Time between location updates #define TEAM_LOCATION_UPDATE_TIME 1000 @@ -847,18 +818,27 @@ typedef enum PCL_HUMAN_BSUIT, PCL_NUM_CLASSES -} pClass_t; +} class_t; +// spectator state +typedef enum +{ + SPECTATOR_NOT, + SPECTATOR_FREE, + SPECTATOR_LOCKED, + SPECTATOR_FOLLOW, + SPECTATOR_SCOREBOARD +} spectatorState_t; // player teams typedef enum { - PTE_NONE, - PTE_ALIENS, - PTE_HUMANS, + TEAM_NONE, + TEAM_ALIENS, + TEAM_HUMANS, - PTE_NUM_TEAMS -} pTeam_t; + NUM_TEAMS +} team_t; // means of death @@ -1106,7 +1086,7 @@ typedef struct qboolean purchasable; qboolean longRanged; - WUTeam_t team; + team_t team; } weaponAttributes_t; // upgrade record @@ -1128,7 +1108,7 @@ typedef struct qboolean purchasable; qboolean usable; - WUTeam_t team; + team_t team; } upgradeAttributes_t; qboolean BG_WeaponIsFull( weapon_t weapon, int stats[ ], int ammo, int clips ); @@ -1255,7 +1235,7 @@ float BG_FindZoomFovForWeapon( int weapon ); qboolean BG_FindPurchasableForWeapon( int weapon ); qboolean BG_FindLongRangedForWeapon( int weapon ); int BG_FindBuildDelayForWeapon( int weapon ); -WUTeam_t BG_FindTeamForWeapon( int weapon ); +team_t BG_FindTeamForWeapon( int weapon ); int BG_FindPriceForUpgrade( int upgrade ); qboolean BG_FindStagesForUpgrade( int upgrade, stage_t stage ); @@ -1267,7 +1247,7 @@ char *BG_FindInfoForUpgrade( int upgrade ); char *BG_FindIconForUpgrade( int upgrade ); qboolean BG_FindPurchasableForUpgrade( int upgrade ); qboolean BG_FindUsableForUpgrade( int upgrade ); -WUTeam_t BG_FindTeamForUpgrade( int upgrade ); +team_t BG_FindTeamForUpgrade( int upgrade ); // content masks #define MASK_ALL (-1) @@ -1338,12 +1318,12 @@ int atoi_neg( char *token, qboolean allowNegative ); void BG_ParseCSVEquipmentList( const char *string, weapon_t *weapons, int weaponsSize, upgrade_t *upgrades, int upgradesSize ); -void BG_ParseCSVClassList( const char *string, pClass_t *classes, int classesSize ); +void BG_ParseCSVClassList( const char *string, class_t *classes, int classesSize ); void BG_ParseCSVBuildableList( const char *string, buildable_t *buildables, int buildablesSize ); void BG_InitAllowedGameElements( void ); qboolean BG_WeaponIsAllowed( weapon_t weapon ); qboolean BG_UpgradeIsAllowed( upgrade_t upgrade ); -qboolean BG_ClassIsAllowed( pClass_t class ); +qboolean BG_ClassIsAllowed( class_t class ); qboolean BG_BuildableIsAllowed( buildable_t buildable ); typedef struct diff --git a/src/game/g_active.c b/src/game/g_active.c index 63e9feaf..dc681996 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -200,9 +200,9 @@ static int GetClientMass( gentity_t *ent ) { int entMass = 75; - if( ent->client->pers.teamSelection == PTE_ALIENS ) + if( ent->client->pers.teamSelection == TEAM_ALIENS ) entMass = BG_FindHealthForClass( ent->client->pers.classSelection ); - else if( ent->client->pers.teamSelection == PTE_HUMANS ) + else if( ent->client->pers.teamSelection == TEAM_HUMANS ) { if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, ent->client->ps.stats ) ) entMass *= 2; @@ -333,7 +333,7 @@ void G_TouchTriggers( gentity_t *ent ) if( ent->client->ps.stats[ STAT_HEALTH ] <= 0 ) return; - BG_FindBBoxForClass( ent->client->ps.stats[ STAT_PCLASS ], + BG_FindBBoxForClass( ent->client->ps.stats[ STAT_CLASS ], pmins, pmaxs, NULL, NULL, NULL ); VectorAdd( ent->client->ps.origin, pmins, mins ); @@ -359,7 +359,7 @@ void G_TouchTriggers( gentity_t *ent ) continue; // ignore most entities if a spectator - if( ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) || + if( ( ent->client->sess.spectatorState != SPECTATOR_NOT ) || ( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) || ( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) { @@ -413,14 +413,14 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) clientNum = client->sess.spectatorClient; if( clientNum < 0 || clientNum > level.maxclients || !g_entities[ clientNum ].client || - !g_entities[ clientNum ].client->sess.sessionTeam == TEAM_SPECTATOR ) + g_entities[ clientNum ].client->sess.spectatorState != SPECTATOR_NOT ) following = qfalse; } // Check to see if we are in the spawn queue - if( client->pers.teamSelection == PTE_ALIENS ) + if( client->pers.teamSelection == TEAM_ALIENS ) queued = G_SearchSpawnQueue( &level.alienSpawnQueue, ent - g_entities ); - else if( client->pers.teamSelection == PTE_HUMANS ) + else if( client->pers.teamSelection == TEAM_HUMANS ) queued = G_SearchSpawnQueue( &level.humanSpawnQueue, ent - g_entities ); else queued = qfalse; @@ -430,12 +430,12 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) { if( client->sess.spectatorState == SPECTATOR_FOLLOW ) G_StopFollowing( ent ); - if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) G_RemoveFromSpawnQueue( &level.alienSpawnQueue, client->ps.clientNum ); - else if( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) G_RemoveFromSpawnQueue( &level.humanSpawnQueue, client->ps.clientNum ); client->pers.classSelection = PCL_NONE; - client->ps.stats[ STAT_PCLASS ] = PCL_NONE; + client->ps.stats[ STAT_CLASS ] = PCL_NONE; client->ps.pm_flags &= ~PMF_QUEUED; queued = qfalse; } @@ -444,11 +444,11 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) // Wants to get into spawn queue if( client->sess.spectatorState == SPECTATOR_FOLLOW ) G_StopFollowing( ent ); - if( client->pers.teamSelection == PTE_NONE ) + if( client->pers.teamSelection == TEAM_NONE ) G_TriggerMenu( client->ps.clientNum, MN_TEAM ); - else if( client->pers.teamSelection == PTE_ALIENS ) + else if( client->pers.teamSelection == TEAM_ALIENS ) G_TriggerMenu( client->ps.clientNum, MN_A_CLASS ); - else if( client->pers.teamSelection == PTE_HUMANS ) + else if( client->pers.teamSelection == TEAM_HUMANS ) G_TriggerMenu( client->ps.clientNum, MN_H_SPAWN ); } @@ -464,11 +464,11 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) if( queued ) client->ps.pm_flags |= PMF_QUEUED; - client->ps.speed = BG_FindSpeedForClass( client->ps.stats[ STAT_PCLASS ] ); + client->ps.speed = BG_FindSpeedForClass( client->ps.stats[ STAT_CLASS ] ); client->ps.stats[ STAT_STAMINA ] = 0; client->ps.stats[ STAT_MISC ] = 0; client->ps.stats[ STAT_BUILDABLE ] = 0; - client->ps.stats[ STAT_PCLASS ] = PCL_NONE; + client->ps.stats[ STAT_CLASS ] = PCL_NONE; client->ps.weapon = WP_NONE; // Set up for pmove @@ -491,13 +491,13 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) // Set the queue position and spawn count for the client side if( client->ps.pm_flags & PMF_QUEUED ) { - if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { client->ps.persistant[ PERS_QUEUEPOS ] = G_GetPosInSpawnQueue( &level.alienSpawnQueue, client->ps.clientNum ); client->ps.persistant[ PERS_SPAWNS ] = level.numAlienSpawns; } - else if( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { client->ps.persistant[ PERS_QUEUEPOS ] = G_GetPosInSpawnQueue( &level.humanSpawnQueue, client->ps.clientNum ); @@ -634,7 +634,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) // Set validity bit on buildable if( ( client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) > BA_NONE ) { - int dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_PCLASS ] ); + int dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_CLASS ] ); vec3_t dummy; if( G_CanBuild( ent, client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT, @@ -663,7 +663,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) break; } - if( ent->client->pers.teamSelection == PTE_HUMANS && + if( ent->client->pers.teamSelection == TEAM_HUMANS && ( client->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) ) { int remainingStartupTime = MEDKIT_STARTUP_TIME - ( level.time - client->lastMedKitTime ); @@ -725,8 +725,8 @@ void ClientTimerActions( gentity_t *ent, int msec ) } //replenish alien health - if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && - level.surrenderTeam != PTE_ALIENS ) + if( client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS && + level.surrenderTeam != TEAM_ALIENS ) { int entityList[ MAX_GENTITIES ]; vec3_t range = { LEVEL4_REGEN_RANGE, LEVEL4_REGEN_RANGE, LEVEL4_REGEN_RANGE }; @@ -750,7 +750,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) boostEntity->spawned && boostEntity->health > 0) new_modifier = BOOSTER_REGEN_MOD; else if( boostEntity->client && boostEntity->health > 0 && - boostEntity->client->pers.teamSelection == PTE_ALIENS ) + boostEntity->client->pers.teamSelection == TEAM_ALIENS ) { if( boostEntity->client->pers.classSelection == PCL_ALIEN_LEVEL1_UPG ) new_modifier = LEVEL1_UPG_REGEN_MOD; @@ -783,14 +783,14 @@ void ClientTimerActions( gentity_t *ent, int msec ) if( ( ent->lastRegenTime + ALIEN_REGEN_NOCREEP_TIME ) < level.time ) { ent->health += - BG_FindRegenRateForClass( client->ps.stats[ STAT_PCLASS ] ); + BG_FindRegenRateForClass( client->ps.stats[ STAT_CLASS ] ); ent->lastRegenTime = level.time; } } else { ent->health += modifier * - BG_FindRegenRateForClass( client->ps.stats[ STAT_PCLASS ] ); + BG_FindRegenRateForClass( client->ps.stats[ STAT_CLASS ] ); ent->lastRegenTime = level.time; } } @@ -800,15 +800,15 @@ void ClientTimerActions( gentity_t *ent, int msec ) } // turn off life support when a team admits defeat - if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && - level.surrenderTeam == PTE_ALIENS ) + if( client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS && + level.surrenderTeam == TEAM_ALIENS ) { G_Damage( ent, NULL, NULL, NULL, NULL, - BG_FindRegenRateForClass( client->ps.stats[ STAT_PCLASS ] ), + BG_FindRegenRateForClass( client->ps.stats[ STAT_CLASS ] ), DAMAGE_NO_ARMOR, MOD_SUICIDE ); } - else if( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && - level.surrenderTeam == PTE_HUMANS ) + else if( client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && + level.surrenderTeam == TEAM_HUMANS ) { G_Damage( ent, NULL, NULL, NULL, NULL, 5, DAMAGE_NO_ARMOR, MOD_SUICIDE ); } @@ -871,10 +871,10 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) vec3_t dir; vec3_t point, mins; float fallDistance; - pClass_t class; + class_t class; client = ent->client; - class = client->ps.stats[ STAT_PCLASS ]; + class = client->ps.stats[ STAT_CLASS ]; if( oldEventSequence < client->ps.eventSequence - MAX_PS_EVENTS ) oldEventSequence = client->ps.eventSequence - MAX_PS_EVENTS; @@ -1369,7 +1369,7 @@ void ClientThink_real( gentity_t *ent ) } // spectators don't do much - if( client->sess.sessionTeam == TEAM_SPECTATOR ) + if( client->sess.spectatorState != SPECTATOR_NOT ) { if( client->sess.spectatorState == SPECTATOR_SCOREBOARD ) return; @@ -1482,7 +1482,7 @@ void ClientThink_real( gentity_t *ent ) } // set speed - client->ps.speed = g_speed.value * BG_FindSpeedForClass( client->ps.stats[ STAT_PCLASS ] ); + client->ps.speed = g_speed.value * BG_FindSpeedForClass( client->ps.stats[ STAT_CLASS ] ); if( client->lastCreepSlowTime + CREEP_TIMEOUT < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_CREEPSLOWED; @@ -1685,7 +1685,7 @@ void ClientThink_real( gentity_t *ent ) traceEnt = &g_entities[ trace.entityNum ]; - if( traceEnt && traceEnt->biteam == client->ps.stats[ STAT_PTEAM ] && traceEnt->use ) + if( traceEnt && traceEnt->buildableTeam == client->ps.stats[ STAT_TEAM ] && traceEnt->use ) traceEnt->use( traceEnt, ent, ent ); //other and activator are the same in this context else { @@ -1699,16 +1699,16 @@ void ClientThink_real( gentity_t *ent ) { traceEnt = &g_entities[ entityList[ i ] ]; - if( traceEnt && traceEnt->biteam == client->ps.stats[ STAT_PTEAM ] && traceEnt->use ) + if( traceEnt && traceEnt->buildableTeam == client->ps.stats[ STAT_TEAM ] && traceEnt->use ) { traceEnt->use( traceEnt, ent, ent ); //other and activator are the same in this context break; } } - if( i == num && client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( i == num && client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { - if( BG_AlienCanEvolve( client->ps.stats[ STAT_PCLASS ], + if( BG_AlienCanEvolve( client->ps.stats[ STAT_CLASS ], client->ps.persistant[ PERS_CREDIT ], g_alienStage.integer ) ) { @@ -1732,9 +1732,9 @@ void ClientThink_real( gentity_t *ent ) { //gotta love logic like this eh? } - else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + else if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) G_AddCreditToClient( ent->client, FREEKILL_ALIEN, qtrue ); - else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) G_AddCreditToClient( ent->client, FREEKILL_HUMAN, qtrue ); ent->client->lastKillTime = level.time; @@ -1807,7 +1807,7 @@ void SpectatorClientEndFrame( gentity_t *ent ) cl = &level.clients[ clientNum ]; if( cl->pers.connected == CON_CONNECTED ) { - if( cl->sess.sessionTeam != TEAM_SPECTATOR ) + if( cl->sess.spectatorState == SPECTATOR_NOT ) { // Save flags = ( cl->ps.eFlags & ~( EF_VOTED | EF_TEAMVOTED ) ) | @@ -1845,7 +1845,7 @@ void ClientEndFrame( gentity_t *ent ) { clientPersistant_t *pers; - if( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) + if( ent->client->sess.spectatorState != SPECTATOR_NOT ) { SpectatorClientEndFrame( ent ); return; diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 3a25e248..deaedf35 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1878,7 +1878,7 @@ qboolean G_admin_putteam( gentity_t *ent, int skiparg ) int pids[ MAX_CLIENTS ], found; char name[ MAX_NAME_LENGTH ], team[ 7 ], err[ MAX_STRING_CHARS ]; gentity_t *vic; - pTeam_t teamnum = PTE_NONE; + team_t teamnum = TEAM_NONE; char teamdesc[ 32 ] = {"spectators"}; G_SayArgv( 1 + skiparg, name, sizeof( name ) ); @@ -1905,15 +1905,15 @@ qboolean G_admin_putteam( gentity_t *ent, int skiparg ) switch( team[ 0 ] ) { case 'a': - teamnum = PTE_ALIENS; + teamnum = TEAM_ALIENS; Q_strncpyz( teamdesc, "aliens", sizeof( teamdesc ) ); break; case 'h': - teamnum = PTE_HUMANS; + teamnum = TEAM_HUMANS; Q_strncpyz( teamdesc, "humans", sizeof( teamdesc ) ); break; case 's': - teamnum = PTE_NONE; + teamnum = TEAM_NONE; break; default: ADMP( va( "^3!putteam: ^7unknown team %c\n", team[ 0 ] ) ); @@ -2232,12 +2232,12 @@ qboolean G_admin_listplayers( gentity_t *ent, int skiparg ) p = &level.clients[ i ]; Q_strncpyz( t, "S", sizeof( t ) ); Q_strncpyz( c, S_COLOR_YELLOW, sizeof( c ) ); - if( p->pers.teamSelection == PTE_HUMANS ) + if( p->pers.teamSelection == TEAM_HUMANS ) { Q_strncpyz( t, "H", sizeof( t ) ); Q_strncpyz( c, S_COLOR_BLUE, sizeof( c ) ); } - else if( p->pers.teamSelection == PTE_ALIENS ) + else if( p->pers.teamSelection == TEAM_ALIENS ) { Q_strncpyz( t, "A", sizeof( t ) ); Q_strncpyz( c, S_COLOR_RED, sizeof( c ) ); @@ -2622,7 +2622,7 @@ qboolean G_admin_allready( gentity_t *ent, int skiparg ) if( cl->pers.connected != CON_CONNECTED ) continue; - if( cl->pers.teamSelection == PTE_NONE ) + if( cl->pers.teamSelection == TEAM_NONE ) continue; cl->readyToExit = 1; @@ -2645,10 +2645,10 @@ qboolean G_admin_cancelvote( gentity_t *ent, int skiparg ) CheckVote( ); level.teamVoteNo[ 0 ] = level.numConnectedClients; level.teamVoteYes[ 0 ] = 0; - CheckTeamVote( PTE_HUMANS ); + CheckTeamVote( TEAM_HUMANS ); level.teamVoteNo[ 1 ] = level.numConnectedClients; level.teamVoteYes[ 1 ] = 0; - CheckTeamVote( PTE_ALIENS ); + CheckTeamVote( TEAM_ALIENS ); AP( va( "print \"^3!cancelvote: ^7%s^7 decided that everyone voted No\n\"", ( ent ) ? ent->client->pers.netname : "console" ) ); return qtrue; @@ -2666,10 +2666,10 @@ qboolean G_admin_passvote( gentity_t *ent, int skiparg ) CheckVote( ); level.teamVoteYes[ 0 ] = level.numConnectedClients; level.teamVoteNo[ 0 ] = 0; - CheckTeamVote( PTE_HUMANS ); + CheckTeamVote( TEAM_HUMANS ); level.teamVoteYes[ 1 ] = level.numConnectedClients; level.teamVoteNo[ 1 ] = 0; - CheckTeamVote( PTE_ALIENS ); + CheckTeamVote( TEAM_ALIENS ); AP( va( "print \"^3!passvote: ^7%s^7 decided that everyone voted Yes\n\"", ( ent ) ? ent->client->pers.netname : "console" ) ); return qtrue; @@ -2687,11 +2687,11 @@ qboolean G_admin_spec999( gentity_t *ent, int skiparg ) continue; if( vic->client->pers.connected != CON_CONNECTED ) continue; - if( vic->client->pers.teamSelection == PTE_NONE ) + if( vic->client->pers.teamSelection == TEAM_NONE ) continue; if( vic->client->ps.ping == 999 ) { - G_ChangeTeam( vic, PTE_NONE ); + G_ChangeTeam( vic, TEAM_NONE ); AP( va( "print \"^3!spec999: ^7%s^7 moved ^7%s^7 to spectators\n\"", ( ent ) ? ent->client->pers.netname : "console", vic->client->pers.netname ) ); @@ -2787,7 +2787,7 @@ qboolean G_admin_nextmap( gentity_t *ent, int skiparg ) { AP( va( "print \"^3!nextmap: ^7%s^7 decided to load the next map\n\"", ( ent ) ? ent->client->pers.netname : "console" ) ); - level.lastWin = PTE_NONE; + level.lastWin = TEAM_NONE; trap_SetConfigstring( CS_WINNER, "Evacuation" ); LogExit( va( "nextmap was run by %s", ( ent ) ? ent->client->pers.netname : "console" ) ); @@ -2853,7 +2853,7 @@ qboolean G_admin_namelog( gentity_t *ent, int skiparg ) qboolean G_admin_lock( gentity_t *ent, int skiparg ) { char teamName[2] = {""}; - pTeam_t team; + team_t team; if( G_SayArgc() < 2 + skiparg ) { @@ -2862,16 +2862,16 @@ qboolean G_admin_lock( gentity_t *ent, int skiparg ) } G_SayArgv( 1 + skiparg, teamName, sizeof( teamName ) ); if( teamName[ 0 ] == 'a' || teamName[ 0 ] == 'A' ) - team = PTE_ALIENS; + team = TEAM_ALIENS; else if( teamName[ 0 ] == 'h' || teamName[ 0 ] == 'H' ) - team = PTE_HUMANS; + team = TEAM_HUMANS; else { ADMP( va( "^3!lock: ^7invalid team\"%c\"\n", teamName[0] ) ); return qfalse; } - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { if( level.alienTeamLocked ) { @@ -2881,7 +2881,7 @@ qboolean G_admin_lock( gentity_t *ent, int skiparg ) else level.alienTeamLocked = qtrue; } - else if( team == PTE_HUMANS ) { + else if( team == TEAM_HUMANS ) { if( level.humanTeamLocked ) { ADMP( "^3!lock: ^7Human team is already locked\n" ); @@ -2892,7 +2892,7 @@ qboolean G_admin_lock( gentity_t *ent, int skiparg ) } AP( va( "print \"^3!lock: ^7%s team has been locked by %s\n\"", - ( team == PTE_ALIENS ) ? "Alien" : "Human", + ( team == TEAM_ALIENS ) ? "Alien" : "Human", ( ent ) ? ent->client->pers.netname : "console" ) ); return qtrue; } @@ -2900,7 +2900,7 @@ qboolean G_admin_lock( gentity_t *ent, int skiparg ) qboolean G_admin_unlock( gentity_t *ent, int skiparg ) { char teamName[2] = {""}; - pTeam_t team; + team_t team; if( G_SayArgc() < 2 + skiparg ) { @@ -2909,16 +2909,16 @@ qboolean G_admin_unlock( gentity_t *ent, int skiparg ) } G_SayArgv( 1 + skiparg, teamName, sizeof( teamName ) ); if( teamName[ 0 ] == 'a' || teamName[ 0 ] == 'A' ) - team = PTE_ALIENS; + team = TEAM_ALIENS; else if( teamName[ 0 ] == 'h' || teamName[ 0 ] == 'H' ) - team = PTE_HUMANS; + team = TEAM_HUMANS; else { ADMP( va( "^3!unlock: ^7invalid team\"%c\"\n", teamName[0] ) ); return qfalse; } - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { if( !level.alienTeamLocked ) { @@ -2928,7 +2928,7 @@ qboolean G_admin_unlock( gentity_t *ent, int skiparg ) else level.alienTeamLocked = qfalse; } - else if( team == PTE_HUMANS ) { + else if( team == TEAM_HUMANS ) { if( !level.humanTeamLocked ) { ADMP( "^3!unlock: ^7Human team is not currently locked\n" ); @@ -2939,7 +2939,7 @@ qboolean G_admin_unlock( gentity_t *ent, int skiparg ) } AP( va( "print \"^3!unlock: ^7%s team has been unlocked by %s\n\"", - ( team == PTE_ALIENS ) ? "Alien" : "Human", + ( team == TEAM_ALIENS ) ? "Alien" : "Human", ( ent ) ? ent->client->pers.netname : "console" ) ); return qtrue; } diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index c8d07e4c..1e575a93 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -170,7 +170,7 @@ static qboolean G_FindPower( gentity_t *self ) int minDistance = REPEATER_BASESIZE + 1; vec3_t temp_v; - if( self->biteam != BIT_HUMANS ) + if( self->buildableTeam != TEAM_HUMANS ) return qfalse; //reactor is always powered @@ -234,7 +234,7 @@ static gentity_t *G_PowerEntityForPoint( vec3_t origin ) gentity_t dummy; dummy.parentNode = NULL; - dummy.biteam = BIT_HUMANS; + dummy.buildableTeam = TEAM_HUMANS; dummy.s.modelindex = BA_NONE; VectorCopy( origin, dummy.s.origin ); @@ -277,7 +277,7 @@ int G_FindDCC( gentity_t *self ) vec3_t temp_v; int foundDCC = 0; - if( self->biteam != BIT_HUMANS ) + if( self->buildableTeam != TEAM_HUMANS ) return 0; //iterate through entities @@ -314,7 +314,7 @@ qboolean G_IsDCCBuilt( void ) memset( &dummy, 0, sizeof( gentity_t ) ); - dummy.biteam = BIT_HUMANS; + dummy.buildableTeam = TEAM_HUMANS; return G_FindDCC( &dummy ); } @@ -331,7 +331,7 @@ static qboolean G_FindOvermind( gentity_t *self ) int i; gentity_t *ent; - if( self->biteam != BIT_ALIENS ) + if( self->buildableTeam != TEAM_ALIENS ) return qfalse; //if this already has overmind then stop now @@ -372,7 +372,7 @@ qboolean G_IsOvermindBuilt( void ) memset( &dummy, 0, sizeof( gentity_t ) ); dummy.overmindNode = NULL; - dummy.biteam = BIT_ALIENS; + dummy.buildableTeam = TEAM_ALIENS; return G_FindOvermind( &dummy ); } @@ -485,7 +485,7 @@ static void G_CreepSlow( gentity_t *self ) { enemy = &g_entities[ entityList[ i ] ]; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( enemy->client && enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && enemy->client->ps.groundEntityNum != ENTITYNUM_NONE ) { enemy->client->ps.stats[ STAT_STATE ] |= SS_CREEPSLOWED; @@ -567,7 +567,7 @@ void AGeneric_Blast( gentity_t *self ) //do a bit of radius damage G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, self->splashRadius, self, self->splashMethodOfDeath, - PTE_ALIENS ); + TEAM_ALIENS ); //pretty events and item cleanup self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed @@ -605,9 +605,9 @@ void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, i if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && + if( attacker->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS && !self->deconstruct ) - G_TeamCommand( PTE_ALIENS, + G_TeamCommand( TEAM_ALIENS, va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", BG_FindHumanNameForBuildable( self->s.modelindex ), attacker->client->pers.netname ) ); @@ -778,7 +778,7 @@ void AOvermind_Think( gentity_t *self ) { //do some damage if( G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, - self->splashRadius, self, MOD_OVERMIND, PTE_ALIENS ) ) + self->splashRadius, self, MOD_OVERMIND, TEAM_ALIENS ) ) { self->timestamp = level.time; G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse ); @@ -983,7 +983,7 @@ void ABarricade_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) gclient_t *client = other->client; int client_z, min_z; - if( !client || client->pers.teamSelection != PTE_ALIENS ) + if( !client || client->pers.teamSelection != TEAM_ALIENS ) return; // Client must be high enough to pass over. Note that STEPSIZE (18) is @@ -1035,7 +1035,7 @@ void AAcidTube_Think( gentity_t *self ) if( !G_Visible( self, enemy, CONTENTS_SOLID ) ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( enemy->client && enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { // start the attack animation if( level.time >= self->timestamp + ACIDTUBE_REPEAT_ANIM ) @@ -1046,7 +1046,7 @@ void AAcidTube_Think( gentity_t *self ) } G_SelectiveRadiusDamage( self->s.pos.trBase, self, ACIDTUBE_DAMAGE, - ACIDTUBE_RANGE, self, MOD_ATUBE, PTE_ALIENS ); + ACIDTUBE_RANGE, self, MOD_ATUBE, TEAM_ALIENS ); self->nextthink = level.time + ACIDTUBE_REPEAT; return; } @@ -1073,7 +1073,7 @@ static qboolean AHive_CheckTarget( gentity_t *self, gentity_t *enemy ) // Check if this is a valid target if( enemy->health <= 0 || !enemy->client || - enemy->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + enemy->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return qfalse; // Check if the tip of the hive can see the target @@ -1162,7 +1162,7 @@ pain function for Alien Hive */ void AHive_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ) { - if( attacker && attacker->client && attacker->biteam == BIT_HUMANS && + if( attacker && attacker->client && attacker->buildableTeam == TEAM_HUMANS && self->spawned && !self->active && G_FindOvermind( self ) ) { vec3_t dirToTarget; @@ -1205,7 +1205,7 @@ qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideEx trace_t tr; BG_FindBBoxForBuildable( BA_A_HOVEL, NULL, hovelMaxs ); - BG_FindBBoxForClass( player->client->ps.stats[ STAT_PCLASS ], + BG_FindBBoxForClass( player->client->ps.stats[ STAT_CLASS ], mins, maxs, NULL, NULL, NULL ); VectorCopy( hovel->s.origin2, normal ); @@ -1279,8 +1279,8 @@ void AHovel_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) //this hovel is in use G_TriggerMenu( activator->client->ps.clientNum, MN_A_HOVEL_OCCUPIED ); } - else if( ( ( activator->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 ) || - ( activator->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG ) ) && + else if( ( ( activator->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0 ) || + ( activator->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ) ) && activator->health > 0 && self->health > 0 ) { if( AHovel_Blocked( self, activator, qfalse ) ) @@ -1413,7 +1413,7 @@ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) if( !client ) return; - if( client && client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( client && client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) return; client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; @@ -1443,7 +1443,7 @@ void ATrapper_FireOnEnemy( gentity_t *self, int firespeed, float range ) int lowMsec = 0; int highMsec = (int)( ( ( ( distanceToTarget * LOCKBLOB_SPEED ) + - ( distanceToTarget * BG_FindSpeedForClass( enemy->client->ps.stats[ STAT_PCLASS ] ) ) ) / + ( distanceToTarget * BG_FindSpeedForClass( enemy->client->ps.stats[ STAT_CLASS ] ) ) ) / ( LOCKBLOB_SPEED * LOCKBLOB_SPEED ) ) * 1000.0f ); VectorScale( enemy->acceleration, 1.0f / 2.0f, halfAcceleration ); @@ -1500,9 +1500,9 @@ qboolean ATrapper_CheckTarget( gentity_t *self, gentity_t *target, int range ) return qfalse; if( !target->client ) // is the target a bot or player? return qfalse; - if( target->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) // one of us? + if( target->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) // one of us? return qfalse; - if( target->client->sess.sessionTeam == TEAM_SPECTATOR ) // is the target alive? + if( target->client->sess.spectatorState != SPECTATOR_NOT ) // is the target alive? return qfalse; if( target->health <= 0 ) // is the target still alive? return qfalse; @@ -1690,7 +1690,7 @@ void HReactor_Think( gentity_t *self ) { enemy = &g_entities[ entityList[ i ] ]; if( !enemy->client || - enemy->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + enemy->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) continue; tent = G_TempEntity( enemy->s.pos.trBase, EV_TESLATRAIL ); @@ -1708,12 +1708,12 @@ void HReactor_Think( gentity_t *self ) G_SelectiveRadiusDamage( self->s.pos.trBase, self, REACTOR_ATTACK_DCC_DAMAGE, REACTOR_ATTACK_DCC_RANGE, self, - MOD_REACTOR, PTE_HUMANS ); + MOD_REACTOR, TEAM_HUMANS ); else G_SelectiveRadiusDamage( self->s.pos.trBase, self, REACTOR_ATTACK_DAMAGE, REACTOR_ATTACK_RANGE, self, - MOD_REACTOR, PTE_HUMANS ); + MOD_REACTOR, TEAM_HUMANS ); } } @@ -1739,7 +1739,7 @@ void HArmoury_Activate( gentity_t *self, gentity_t *other, gentity_t *activator if( self->spawned ) { //only humans can activate this - if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( activator->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; //if this is powered then call the armoury menu @@ -1869,7 +1869,7 @@ void HMedistat_Think( gentity_t *self ) player = &g_entities[ entityList[ i ] ]; if( self->enemy == player && player->client && - player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] && player->client->ps.pm_type != PM_DEAD ) { @@ -1887,7 +1887,7 @@ void HMedistat_Think( gentity_t *self ) { player = &g_entities[ entityList[ i ] ]; - if( player->client && player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( player->client && player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { if( ( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] || player->client->ps.stats[ STAT_STAMINA ] < MAX_STAMINA ) && @@ -1963,7 +1963,7 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target, vec3_t dir, end; if( !target || target->health <= 0 || !target->client || - target->client->pers.teamSelection != PTE_ALIENS || + target->client->pers.teamSelection != TEAM_ALIENS || ( target->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) return qfalse; @@ -2194,7 +2194,7 @@ void HTeslaGen_Think( gentity_t *self ) { self->enemy = &g_entities[ entityList[ i ] ]; if( self->enemy->client && self->enemy->health > 0 && - self->enemy->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && + self->enemy->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS && Distance( self->enemy->s.pos.trBase, self->s.pos.trBase ) <= TESLAGEN_RANGE ) FireWeapon( self ); @@ -2310,9 +2310,9 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( attacker->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && !self->deconstruct ) - G_TeamCommand( PTE_HUMANS, + G_TeamCommand( TEAM_HUMANS, va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", BG_FindHumanNameForBuildable( self->s.modelindex ), attacker->client->pers.netname ) ); @@ -2457,12 +2457,12 @@ void G_BuildableThink( gentity_t *ent, int msec ) ent->health += (int)( ceil( (float)bHealth / (float)( bTime * 0.001 ) ) ); else if( ent->health > 0 && ent->health < bHealth ) { - if( ent->biteam == BIT_ALIENS && bRegen && + if( ent->buildableTeam == TEAM_ALIENS && bRegen && ( ent->lastDamageTime + ALIEN_REGEN_DAMAGE_TIME ) < level.time ) { ent->health += bRegen; } - else if( ent->biteam == BIT_HUMANS && ent->dcc && + else if( ent->buildableTeam == TEAM_HUMANS && ent->dcc && ( ent->lastDamageTime + HUMAN_REGEN_DAMAGE_TIME ) < level.time ) { ent->health += DC_HEALRATE * ent->dcc; @@ -2483,7 +2483,7 @@ void G_BuildableThink( gentity_t *ent, int msec ) ent->clientSpawnTime = 0; // Pack health - ent->dcc = ( ent->biteam != BIT_HUMANS ) ? 0 : G_FindDCC( ent ); + ent->dcc = ( ent->buildableTeam != TEAM_HUMANS ) ? 0 : G_FindDCC( ent ); if( ent->health > 0 ) { ent->s.generic1 = (int)( ( ent->health + bHealth / B_HEALTH_MASK - 1 ) * @@ -2538,7 +2538,7 @@ qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ) if( ent->s.eType != ET_BUILDABLE ) continue; - if( ent->biteam == BIT_HUMANS && !ent->powered ) + if( ent->buildableTeam == TEAM_HUMANS && !ent->powered ) continue; if( ent->s.modelindex == buildable && ent->spawned ) @@ -2725,7 +2725,7 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable, int numBuildables = 0; int pointsYielded = 0; gentity_t *ent; - buildableTeam_t team = BG_FindTeamForBuildable( buildable ); + team_t team = BG_FindTeamForBuildable( buildable ); int buildPoints = BG_FindBuildPointsForBuildable( buildable ); int remainingBP, remainingSpawns; qboolean collision = qfalse; @@ -2737,7 +2737,7 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable, buildable_t core; int spawnCount = 0; - if( team == BIT_ALIENS ) + if( team == TEAM_ALIENS ) { remainingBP = level.alienBuildPoints; remainingSpawns = level.numAlienSpawns; @@ -2745,7 +2745,7 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable, spawn = BA_A_SPAWN; core = BA_A_OVERMIND; } - else if( team == BIT_HUMANS ) + else if( team == TEAM_HUMANS ) { remainingBP = level.humanBuildPoints; remainingSpawns = level.numHumanSpawns; @@ -2823,7 +2823,7 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable, if( ent->health <= 0 ) continue; - if( ent->biteam != team ) + if( ent->buildableTeam != team ) continue; // Don't allow destruction of hovel with granger inside @@ -2983,7 +2983,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance contents = trap_PointContents( entity_origin, -1 ); buildPoints = BG_FindBuildPointsForBuildable( buildable ); - if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { //alien criteria @@ -3018,7 +3018,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance if( tr1.surfaceFlags & SURF_NOALIENBUILD || contents & CONTENTS_NOALIENBUILD ) reason = IBE_PERMISSION; } - else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { //human criteria @@ -3121,7 +3121,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori built->killedBy = ENTITYNUM_NONE; built->classname = BG_FindEntityNameForBuildable( buildable ); built->s.modelindex = buildable; - built->biteam = built->s.modelindex2 = BG_FindTeamForBuildable( buildable ); + built->buildableTeam = built->s.modelindex2 = BG_FindTeamForBuildable( buildable ); BG_FindBBoxForBuildable( buildable, built->r.mins, built->r.maxs ); // detect the buildable's normal vector @@ -3310,7 +3310,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori if( built->s.generic1 < 0 ) built->s.generic1 = 0; - if( BG_FindTeamForBuildable( built->s.modelindex ) == PTE_ALIENS ) + if( BG_FindTeamForBuildable( built->s.modelindex ) == TEAM_ALIENS ) { built->powered = qtrue; built->s.eFlags |= EF_B_POWERED; @@ -3344,7 +3344,7 @@ qboolean G_BuildIfValid( gentity_t *ent, buildable_t buildable ) float dist; vec3_t origin; - dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_PCLASS ] ); + dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_CLASS ] ); switch( G_CanBuild( ent, buildable, dist, origin ) ) { @@ -3767,7 +3767,7 @@ void G_LayoutLoad( void ) G_BaseSelfDestruct ============ */ -void G_BaseSelfDestruct( pTeam_t team ) +void G_BaseSelfDestruct( team_t team ) { int i; gentity_t *ent; @@ -3779,9 +3779,9 @@ void G_BaseSelfDestruct( pTeam_t team ) continue; if( ent->s.eType != ET_BUILDABLE ) continue; - if( team == PTE_HUMANS && ent->biteam != BIT_HUMANS ) + if( team == TEAM_HUMANS && ent->buildableTeam != TEAM_HUMANS ) continue; - if( team == PTE_ALIENS && ent->biteam != BIT_ALIENS ) + if( team == TEAM_ALIENS && ent->buildableTeam != TEAM_ALIENS ) continue; G_Damage( ent, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE ); } diff --git a/src/game/g_client.c b/src/game/g_client.c index 7c168184..aa91cd46 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -92,7 +92,7 @@ void G_AddCreditToClient( gclient_t *client, short credit, qboolean cap ) return; client->pers.credit += credit; - capAmount = client->pers.teamSelection == PTE_ALIENS ? + capAmount = client->pers.teamSelection == TEAM_ALIENS ? ALIEN_MAX_FRAGS * ALIEN_CREDITS_PER_FRAG : HUMAN_MAX_CREDITS; if( cap && client->pers.credit > capAmount ) @@ -414,22 +414,22 @@ G_SelectTremulousSpawnPoint Chooses a player start, deathmatch start, etc ============ */ -gentity_t *G_SelectTremulousSpawnPoint( pTeam_t team, vec3_t preference, vec3_t origin, vec3_t angles ) +gentity_t *G_SelectTremulousSpawnPoint( team_t team, vec3_t preference, vec3_t origin, vec3_t angles ) { gentity_t *spot = NULL; - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) spot = G_SelectAlienSpawnPoint( preference ); - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) spot = G_SelectHumanSpawnPoint( preference ); //no available spots if( !spot ) return NULL; - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) G_CheckSpawnPoint( spot->s.number, spot->s.origin, spot->s.origin2, BA_A_SPAWN, origin ); - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) G_CheckSpawnPoint( spot->s.number, spot->s.origin, spot->s.origin2, BA_H_SPAWN, origin ); VectorCopy( spot->s.angles, angles ); @@ -628,10 +628,10 @@ void SpawnCorpse( gentity_t *ent ) body->timestamp = level.time; body->s.event = 0; body->r.contents = CONTENTS_CORPSE; - body->s.clientNum = ent->client->ps.stats[ STAT_PCLASS ]; + body->s.clientNum = ent->client->ps.stats[ STAT_CLASS ]; body->nonSegModel = ent->client->ps.persistant[ PERS_STATE ] & PS_NONSEGMODEL; - if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) body->classname = "humanCorpse"; else body->classname = "alienCorpse"; @@ -688,7 +688,7 @@ void SpawnCorpse( gentity_t *ent ) ent->health = 0; //change body dimensions - BG_FindBBoxForClass( ent->client->ps.stats[ STAT_PCLASS ], NULL, NULL, NULL, body->r.mins, body->r.maxs ); + BG_FindBBoxForClass( ent->client->ps.stats[ STAT_CLASS ], NULL, NULL, NULL, body->r.mins, body->r.maxs ); vDiff = body->r.mins[ 2 ] - ent->r.mins[ 2 ]; //drop down to match the *model* origins of ent and body @@ -750,8 +750,7 @@ void respawn( gentity_t *ent ) // stop any following clients that don't have sticky spec on 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 - g_entities ) { if( !( level.clients[ i ].pers.stickySpec ) ) @@ -766,34 +765,6 @@ void respawn( gentity_t *ent ) } /* -================ -TeamCount - -Returns number of players on a team -================ -*/ -team_t TeamCount( int ignoreClientNum, int team ) -{ - int i; - int count = 0; - - for( i = 0 ; i < level.maxclients ; i++ ) - { - if( i == ignoreClientNum ) - continue; - - if( level.clients[ i ].pers.connected == CON_DISCONNECTED ) - continue; - - if( level.clients[ i ].sess.sessionTeam == team ) - count++; - } - - return count; -} - - -/* =========== ClientCheckName ============ @@ -1021,11 +992,8 @@ void ClientUserinfoChanged( int clientNum ) } } - if( client->sess.sessionTeam == TEAM_SPECTATOR ) - { - if( client->sess.spectatorState == SPECTATOR_SCOREBOARD ) - Q_strncpyz( client->pers.netname, "scoreboard", sizeof( client->pers.netname ) ); - } + if( client->sess.spectatorState == SPECTATOR_SCOREBOARD ) + Q_strncpyz( client->pers.netname, "scoreboard", sizeof( client->pers.netname ) ); if( client->pers.connected == CON_CONNECTED ) { @@ -1051,7 +1019,7 @@ void ClientUserinfoChanged( int clientNum ) client->pers.maxHealth = 0; // set model - if( client->ps.stats[ STAT_PCLASS ] == PCL_HUMAN_BSUIT ) + if( client->ps.stats[ STAT_CLASS ] == PCL_HUMAN_BSUIT ) { Com_sprintf( buffer, MAX_QPATH, "%s/%s", BG_FindModelNameForClass( PCL_HUMAN_BSUIT ), BG_FindSkinNameForClass( PCL_HUMAN_BSUIT ) ); @@ -1349,16 +1317,10 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles } // only start client if chosen a class and joined a team - if( client->pers.classSelection == PCL_NONE && teamLocal == PTE_NONE ) - { - client->sess.sessionTeam = TEAM_SPECTATOR; + if( client->pers.classSelection == PCL_NONE && teamLocal == TEAM_NONE ) client->sess.spectatorState = SPECTATOR_FREE; - } else if( client->pers.classSelection == PCL_NONE ) - { - client->sess.sessionTeam = TEAM_SPECTATOR; client->sess.spectatorState = SPECTATOR_LOCKED; - } if( origin != NULL ) VectorCopy( origin, spawn_origin ); @@ -1369,13 +1331,13 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles // find a spawn point // do it before setting health back up, so farthest // ranging doesn't count this client - if( client->sess.sessionTeam == TEAM_SPECTATOR ) + if( client->sess.spectatorState != SPECTATOR_NOT ) { - if( teamLocal == PTE_NONE ) + if( teamLocal == TEAM_NONE ) spawnPoint = G_SelectSpectatorSpawnPoint( spawn_origin, spawn_angles ); - else if( teamLocal == PTE_ALIENS ) + else if( teamLocal == TEAM_ALIENS ) spawnPoint = G_SelectAlienLockSpawnPoint( spawn_origin, spawn_angles ); - else if( teamLocal == PTE_HUMANS ) + else if( teamLocal == TEAM_HUMANS ) spawnPoint = G_SelectHumanLockSpawnPoint( spawn_origin, spawn_angles ); } else @@ -1393,9 +1355,9 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles //start spawn animation on spawnPoint G_SetBuildableAnim( spawnPoint, BANIM_SPAWN1, qtrue ); - if( spawnPoint->biteam == PTE_ALIENS ) + if( spawnPoint->buildableTeam == TEAM_ALIENS ) spawnPoint->clientSpawnTime = ALIEN_SPAWN_REPEAT_TIME; - else if( spawnPoint->biteam == PTE_HUMANS ) + else if( spawnPoint->buildableTeam == TEAM_HUMANS ) spawnPoint->clientSpawnTime = HUMAN_SPAWN_REPEAT_TIME; } } @@ -1430,7 +1392,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles // increment the spawncount so the client will detect the respawn client->ps.persistant[ PERS_SPAWN_COUNT ]++; - client->ps.persistant[ PERS_TEAM ] = client->sess.sessionTeam; + client->ps.persistant[ PERS_SPECSTATE ] = client->sess.spectatorState; // restore really persistant things client->ps.persistant[ PERS_SCORE ] = client->pers.score; @@ -1468,7 +1430,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles BG_FindBBoxForClass( ent->client->pers.classSelection, ent->r.mins, ent->r.maxs, NULL, NULL, NULL ); - if( client->sess.sessionTeam != TEAM_SPECTATOR ) + if( client->sess.spectatorState == SPECTATOR_NOT ) client->pers.maxHealth = client->ps.stats[ STAT_MAX_HEALTH ] = BG_FindHealthForClass( ent->client->pers.classSelection ); else @@ -1481,7 +1443,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles BG_AddUpgradeToInventory( UP_MEDKIT, client->ps.stats ); weapon = client->pers.humanItemSelection; } - else if( client->sess.sessionTeam != TEAM_SPECTATOR ) + else if( client->sess.spectatorState == SPECTATOR_NOT ) weapon = BG_FindStartWeaponForClass( ent->client->pers.classSelection ); else weapon = WP_NONE; @@ -1494,8 +1456,8 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles // We just spawned, not changing weapons client->ps.persistant[ PERS_NEWWEAPON ] = 0; - ent->client->ps.stats[ STAT_PCLASS ] = ent->client->pers.classSelection; - ent->client->ps.stats[ STAT_PTEAM ] = ent->client->pers.teamSelection; + ent->client->ps.stats[ STAT_CLASS ] = ent->client->pers.classSelection; + ent->client->ps.stats[ STAT_TEAM ] = ent->client->pers.teamSelection; ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; ent->client->ps.stats[ STAT_STATE ] = 0; @@ -1524,8 +1486,8 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles #define F_VEL 50.0f //give aliens some spawn velocity - if( client->sess.sessionTeam != TEAM_SPECTATOR && - client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( client->sess.spectatorState == SPECTATOR_NOT && + client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { if( ent == spawn ) { @@ -1552,8 +1514,8 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles G_AddPredictableEvent( ent, EV_PLAYER_RESPAWN, 0 ); } } - else if( client->sess.sessionTeam != TEAM_SPECTATOR && - client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( client->sess.spectatorState == SPECTATOR_NOT && + client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { spawn_angles[ YAW ] += 180.0f; AngleNormalize360( spawn_angles[ YAW ] ); @@ -1565,7 +1527,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles trap_GetUsercmd( client - level.clients, &ent->client->pers.cmd ); G_SetClientViewAngle( ent, spawn_angles ); - if( client->sess.sessionTeam != TEAM_SPECTATOR ) + if( client->sess.spectatorState == SPECTATOR_NOT ) { trap_LinkEntity( ent ); @@ -1617,7 +1579,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles ClientThink( ent-g_entities ); // positively link the client, even if the command times are weird - if( client->sess.sessionTeam != TEAM_SPECTATOR ) + if( client->sess.spectatorState == SPECTATOR_NOT ) { BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue ); VectorCopy( ent->client->ps.origin, ent->r.currentOrigin ); @@ -1671,7 +1633,7 @@ void ClientDisconnect( int clientNum ) // send effect if they were completely connected if( ent->client->pers.connected == CON_CONNECTED && - ent->client->sess.sessionTeam != TEAM_SPECTATOR ) + ent->client->sess.spectatorState == SPECTATOR_NOT ) { tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_OUT ); tent->s.clientNum = ent->s.clientNum; @@ -1688,8 +1650,8 @@ void ClientDisconnect( int clientNum ) ent->inuse = qfalse; ent->classname = "disconnected"; ent->client->pers.connected = CON_DISCONNECTED; - ent->client->ps.persistant[ PERS_TEAM ] = TEAM_FREE; - ent->client->sess.sessionTeam = TEAM_FREE; + ent->client->sess.spectatorState = + ent->client->ps.persistant[ PERS_SPECSTATE ] = SPECTATOR_NOT; trap_SetConfigstring( CS_PLAYERS + clientNum, ""); 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; diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 3e86661e..a19b8604 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -164,7 +164,7 @@ float G_RewardAttackers( gentity_t *self ) BG_FindBuildTimeForBuildable( self->s.modelindex ); } - team = self->biteam; + team = self->buildableTeam; } else return totalDamage; @@ -176,14 +176,14 @@ float G_RewardAttackers( gentity_t *self ) short num = value * self->credits[ i ] / totalDamage; if( !player->client || !self->credits[ i ] || - player->client->ps.stats[ STAT_PTEAM ] == team ) + player->client->ps.stats[ STAT_TEAM ] == team ) continue; G_AddCreditToClient( player->client, num, qtrue ); // add to stage counters - if( player->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( player->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) trap_Cvar_Set( "g_alienCredits", va( "%d", g_alienCredits.integer + num ) ); - else if( player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) trap_Cvar_Set( "g_humanCredits", va( "%d", g_humanCredits.integer + num ) ); self->credits[ i ] = 0; @@ -271,9 +271,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int AddScore( attacker, -1 ); //punish team kills and suicides - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( attacker->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) G_AddCreditToClient( attacker->client, -ALIEN_TK_SUICIDE_PENALTY, qtrue ); - else if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( attacker->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) G_AddCreditToClient( attacker->client, -HUMAN_TK_SUICIDE_PENALTY, qtrue ); } else @@ -301,7 +301,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( client->pers.connected != CON_CONNECTED ) continue; - if( client->sess.sessionTeam != TEAM_SPECTATOR ) + if( client->sess.spectatorState == SPECTATOR_NOT ) continue; if( client->sess.spectatorClient == self->s.number ) @@ -864,7 +864,7 @@ dflags these flags are used to control how T_Damage works void G_SelectiveDamage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int team ) { - if( targ->client && ( team != targ->client->ps.stats[ STAT_PTEAM ] ) ) + if( targ->client && ( team != targ->client->ps.stats[ STAT_TEAM ] ) ) G_Damage( targ, inflictor, attacker, dir, point, damage, dflags, mod ); } @@ -917,7 +917,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, if( targ->client ) { knockback = (int)( (float)knockback * - BG_FindKnockbackScaleForClass( targ->client->ps.stats[ STAT_PCLASS ] ) ); + BG_FindKnockbackScaleForClass( targ->client->ps.stats[ STAT_CLASS ] ) ); } if( knockback > 200 ) @@ -961,7 +961,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, // don't do friendly fire on movement attacks if( ( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE || mod == MOD_LEVEL4_CRUSH ) && - targ->s.eType == ET_BUILDABLE && targ->biteam == BIT_ALIENS ) + targ->s.eType == ET_BUILDABLE && targ->buildableTeam == TEAM_ALIENS ) { return; } @@ -980,7 +980,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, return; if( g_dretchPunt.integer && - targ->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_LEVEL0 ) + targ->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL0 ) { vec3_t dir, push; @@ -994,12 +994,12 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, else if( !g_friendlyFire.integer ) { if( !g_friendlyFireHumans.integer && - targ->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + targ->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { return; } if( !g_friendlyFireAliens.integer && - targ->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + targ->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { return; } @@ -1008,14 +1008,14 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, if( targ->s.eType == ET_BUILDABLE && attacker->client ) { - if( targ->biteam == attacker->client->pers.teamSelection ) + if( targ->buildableTeam == attacker->client->pers.teamSelection ) { if( !g_friendlyBuildableFire.integer ) return; } // base is under attack warning if DCC'd - if( targ->biteam == BIT_HUMANS && G_FindDCC( targ ) && + if( targ->buildableTeam == TEAM_HUMANS && G_FindDCC( targ ) && level.time > level.humanBaseAttackTimer && mod != MOD_DECONSTRUCT && mod != MOD_SUICIDE ) { @@ -1072,13 +1072,13 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, targ->client->lasthurt_client = attacker->s.number; targ->client->lasthurt_mod = mod; take = (int)( take * G_CalcDamageModifier( point, targ, attacker, - client->ps.stats[ STAT_PCLASS ], + client->ps.stats[ STAT_CLASS ], dflags ) + 0.5f ); //if boosted poison every attack if( attacker->client && attacker->client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) { - if( targ->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( targ->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS && mod != MOD_LEVEL2_ZAP && mod != MOD_POISON && mod != MOD_LEVEL1_PCLOUD && targ->client->poisonImmunityTime < level.time ) @@ -1245,7 +1245,7 @@ qboolean G_SelectiveRadiusDamage( vec3_t origin, gentity_t *attacker, float dama points = damage * ( 1.0 - dist / radius ); if( CanDamage( ent, origin ) && ent->client && - ent->client->ps.stats[ STAT_PTEAM ] != team ) + ent->client->ps.stats[ STAT_TEAM ] != team ) { VectorSubtract( ent->r.currentOrigin, origin, dir ); // push the center of mass higher than the origin so players diff --git a/src/game/g_local.h b/src/game/g_local.h index 8cc6807c..d4e5b61a 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -190,10 +190,10 @@ struct gentity_s float wait; float random; - pTeam_t stageTeam; + team_t stageTeam; stage_t stageStage; - int biteam; // buildable item team + team_t buildableTeam; // buildable item team gentity_t *parentNode; // for creep and defence/spawn dependencies qboolean active; // for power repeater, but could be useful elsewhere qboolean locked; // used for turret tracking @@ -232,7 +232,7 @@ struct gentity_s qboolean nonSegModel; // this entity uses a nonsegmented player model buildable_t bTriggers[ BA_NUM_BUILDABLES ]; // which buildables are triggers - pClass_t cTriggers[ PCL_NUM_CLASSES ]; // which classes are triggers + class_t cTriggers[ PCL_NUM_CLASSES ]; // which classes are triggers weapon_t wTriggers[ WP_NUM_WEAPONS ]; // which weapons are triggers upgrade_t uTriggers[ UP_NUM_UPGRADES ]; // which upgrades are triggers @@ -260,15 +260,6 @@ typedef enum typedef enum { - SPECTATOR_NOT, - SPECTATOR_FREE, - SPECTATOR_LOCKED, - SPECTATOR_FOLLOW, - SPECTATOR_SCOREBOARD -} spectatorState_t; - -typedef enum -{ TEAM_BEGIN, // Beginning a team game, spawn at base TEAM_ACTIVE // Now actively playing } playerTeamStateState_t; @@ -303,12 +294,9 @@ typedef struct // MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData() typedef struct { - team_t sessionTeam; int spectatorTime; // for determining next-in-line to play spectatorState_t spectatorState; int spectatorClient; // for chasecam and follow mode - int wins, losses; // tournament stats - qboolean teamLeader; // true when this client is a team leader clientList_t ignoreList; } clientSession_t; @@ -318,7 +306,7 @@ typedef struct typedef struct connectionRecord_s { int clientNum; - pTeam_t clientTeam; + team_t clientTeam; int clientCredit; int ptrCode; @@ -341,10 +329,10 @@ typedef struct int voteCount; // to prevent people from constantly calling votes qboolean teamInfo; // send team overlay updates? - pClass_t classSelection; // player class (copied to ent->client->ps.stats[ STAT_PCLASS ] once spawned) + class_t classSelection; // player class (copied to ent->client->ps.stats[ STAT_CLASS ] once spawned) float evolveHealthFraction; weapon_t humanItemSelection; // humans have a starting item - pTeam_t teamSelection; // player team (copied to ps.stats[ STAT_PTEAM ]) + team_t teamSelection; // player team (copied to ps.stats[ STAT_TEAM ]) int teamChangeTime; // level.time of last team change qboolean joinedATeam; // used to tell when a PTR code is valid @@ -539,7 +527,7 @@ typedef struct int startTime; // level.time the map was started - int teamScores[ TEAM_NUM_TEAMS ]; + int teamScores[ NUM_TEAMS ]; int lastTeamLocationTime; // last time of client team location update qboolean newSession; // don't use any old session data, because @@ -626,7 +614,7 @@ typedef struct int humanBaseAttackTimer; - pTeam_t lastWin; + team_t lastWin; timeWarning_t suddenDeathWarning; timeWarning_t timelimitWarning; @@ -649,7 +637,7 @@ typedef struct char layout[ MAX_QPATH ]; - pTeam_t surrenderTeam; + team_t surrenderTeam; } level_locals_t; #define CMD_CHEAT 0x01 @@ -695,7 +683,7 @@ qboolean G_SayArgv( int n, char *buffer, int bufferLength ); char *G_SayConcatArgs( int start ); void G_DecolorString( char *in, char *out ); void G_LeaveTeam( gentity_t *self ); -void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam ); +void G_ChangeTeam( gentity_t *ent, team_t newTeam ); void G_SanitiseName( char *in, char *out ); void G_PrivateMessage( gentity_t *ent ); void Cmd_Test_f( gentity_t *ent ); @@ -761,7 +749,7 @@ void G_LayoutSave( char *name ); int G_LayoutList( const char *map, char *list, int len ); void G_LayoutSelect( void ); void G_LayoutLoad( void ); -void G_BaseSelfDestruct( pTeam_t team ); +void G_BaseSelfDestruct( team_t team ); // // g_utils.c @@ -770,7 +758,7 @@ int G_ParticleSystemIndex( char *name ); int G_ShaderIndex( char *name ); int G_ModelIndex( char *name ); int G_SoundIndex( char *name ); -void G_TeamCommand( pTeam_t team, char *cmd ); +void G_TeamCommand( team_t team, char *cmd ); void G_KillBox (gentity_t *ent); gentity_t *G_Find (gentity_t *from, int fieldofs, const char *match); gentity_t *G_PickTarget (char *targetname); @@ -862,7 +850,7 @@ void manualTriggerSpectator( gentity_t *trigger, gentity_t *player ); // g_trigger.c // void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace ); -void G_Checktrigger_stages( pTeam_t team, stage_t stage ); +void G_Checktrigger_stages( team_t team, stage_t stage ); // @@ -909,7 +897,7 @@ void G_UpdateZaps( gentity_t *ent ); void G_AddCreditToClient( gclient_t *client, short credit, qboolean cap ); team_t TeamCount( int ignoreClientNum, int team ); void G_SetClientViewAngle( gentity_t *ent, vec3_t angle ); -gentity_t *G_SelectTremulousSpawnPoint( pTeam_t team, vec3_t preference, vec3_t origin, vec3_t angles ); +gentity_t *G_SelectTremulousSpawnPoint( team_t team, vec3_t preference, vec3_t origin, vec3_t angles ); gentity_t *G_SelectSpawnPoint( vec3_t avoidPoint, vec3_t origin, vec3_t angles ); gentity_t *G_SelectAlienLockSpawnPoint( vec3_t origin, vec3_t angles ); gentity_t *G_SelectHumanLockSpawnPoint( vec3_t origin, vec3_t angles ); @@ -1037,7 +1025,7 @@ typedef struct mapRotationCondition_s mapConditionOperator_t op; int numClients; - pTeam_t lastWin; + team_t lastWin; } mapRotationCondition_t; typedef struct mapRotationEntry_s diff --git a/src/game/g_main.c b/src/game/g_main.c index a11499f8..b48c81e7 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -684,7 +684,7 @@ void G_ShutdownGame( int restart ) G_admin_namelog_cleanup( ); level.restarted = qfalse; - level.surrenderTeam = PTE_NONE; + level.surrenderTeam = TEAM_NONE; trap_SetConfigstring( CS_WINNER, "" ); } @@ -968,7 +968,7 @@ G_SpawnClients Spawn queued clients ============ */ -void G_SpawnClients( pTeam_t team ) +void G_SpawnClients( team_t team ) { int clientNum; gentity_t *ent, *spawn; @@ -976,12 +976,12 @@ void G_SpawnClients( pTeam_t team ) spawnQueue_t *sq = NULL; int numSpawns = 0; - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { sq = &level.alienSpawnQueue; numSpawns = level.numAlienSpawns; } - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) { sq = &level.humanSpawnQueue; numSpawns = level.numHumanSpawns; @@ -1003,7 +1003,7 @@ void G_SpawnClients( pTeam_t team ) ent = &g_entities[ clientNum ]; - ent->client->sess.sessionTeam = TEAM_FREE; + ent->client->sess.spectatorState = SPECTATOR_NOT; ClientUserinfoChanged( clientNum ); ClientSpawn( ent, spawn, spawn_origin, spawn_angles ); } @@ -1125,7 +1125,7 @@ void G_CalculateBuildPoints( void ) if( buildable == BA_A_OVERMIND && ent->spawned && ent->health > 0 ) level.overmindPresent = qtrue; - if( BG_FindTeamForBuildable( buildable ) == BIT_HUMANS ) + if( BG_FindTeamForBuildable( buildable ) == TEAM_HUMANS ) { level.humanBuildPoints -= BG_FindBuildPointsForBuildable( buildable ); @@ -1212,7 +1212,7 @@ void G_CalculateStages( void ) (int)( ceil( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) ) && g_alienStage.integer == S1 && g_alienMaxStage.integer > S1 ) { - G_Checktrigger_stages( PTE_ALIENS, S2 ); + G_Checktrigger_stages( TEAM_ALIENS, S2 ); trap_Cvar_Set( "g_alienStage", va( "%d", S2 ) ); level.alienStage2Time = level.time; lastAlienStageModCount = g_alienStage.modificationCount; @@ -1222,7 +1222,7 @@ void G_CalculateStages( void ) (int)( ceil( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) ) && g_alienStage.integer == S2 && g_alienMaxStage.integer > S2 ) { - G_Checktrigger_stages( PTE_ALIENS, S3 ); + G_Checktrigger_stages( TEAM_ALIENS, S3 ); trap_Cvar_Set( "g_alienStage", va( "%d", S3 ) ); level.alienStage3Time = level.time; lastAlienStageModCount = g_alienStage.modificationCount; @@ -1232,7 +1232,7 @@ void G_CalculateStages( void ) (int)( ceil( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) ) && g_humanStage.integer == S1 && g_humanMaxStage.integer > S1 ) { - G_Checktrigger_stages( PTE_HUMANS, S2 ); + G_Checktrigger_stages( TEAM_HUMANS, S2 ); trap_Cvar_Set( "g_humanStage", va( "%d", S2 ) ); level.humanStage2Time = level.time; lastHumanStageModCount = g_humanStage.modificationCount; @@ -1242,7 +1242,7 @@ void G_CalculateStages( void ) (int)( ceil( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) ) && g_humanStage.integer == S2 && g_humanMaxStage.integer > S2 ) { - G_Checktrigger_stages( PTE_HUMANS, S3 ); + G_Checktrigger_stages( TEAM_HUMANS, S3 ); trap_Cvar_Set( "g_humanStage", va( "%d", S3 ) ); level.humanStage3Time = level.time; lastHumanStageModCount = g_humanStage.modificationCount; @@ -1250,7 +1250,7 @@ void G_CalculateStages( void ) if( g_alienStage.modificationCount > lastAlienStageModCount ) { - G_Checktrigger_stages( PTE_ALIENS, g_alienStage.integer ); + G_Checktrigger_stages( TEAM_ALIENS, g_alienStage.integer ); if( g_alienStage.integer == S2 ) level.alienStage2Time = level.time; @@ -1262,7 +1262,7 @@ void G_CalculateStages( void ) if( g_humanStage.modificationCount > lastHumanStageModCount ) { - G_Checktrigger_stages( PTE_HUMANS, g_humanStage.integer ); + G_Checktrigger_stages( TEAM_HUMANS, g_humanStage.integer ); if( g_humanStage.integer == S2 ) level.humanStage2Time = level.time; @@ -1347,19 +1347,19 @@ void CalculateRanks( void ) continue; level.numVotingClients++; - if( level.clients[ i ].pers.teamSelection != PTE_NONE ) + if( level.clients[ i ].pers.teamSelection != TEAM_NONE ) { level.numPlayingClients++; - if( level.clients[ i ].pers.teamSelection == PTE_ALIENS ) + if( level.clients[ i ].pers.teamSelection == TEAM_ALIENS ) { level.numAlienClients++; - if( level.clients[ i ].sess.sessionTeam != TEAM_SPECTATOR ) + if( level.clients[ i ].sess.spectatorState == SPECTATOR_NOT ) level.numLiveAlienClients++; } - else if( level.clients[ i ].pers.teamSelection == PTE_HUMANS ) + else if( level.clients[ i ].pers.teamSelection == TEAM_HUMANS ) { level.numHumanClients++; - if( level.clients[ i ].sess.sessionTeam != TEAM_SPECTATOR ) + if( level.clients[ i ].sess.spectatorState == SPECTATOR_NOT ) level.numLiveHumanClients++; } } @@ -1615,7 +1615,7 @@ void QDECL G_LogPrintf( const char *fmt, ... ) G_SendGameStat ================= */ -void G_SendGameStat( pTeam_t team ) +void G_SendGameStat( team_t team ) { char map[ MAX_STRING_CHARS ]; char teamChar; @@ -1628,9 +1628,9 @@ void G_SendGameStat( pTeam_t team ) switch( team ) { - case PTE_ALIENS: teamChar = 'A'; break; - case PTE_HUMANS: teamChar = 'H'; break; - case PTE_NONE: teamChar = 'L'; break; + case TEAM_ALIENS: teamChar = 'A'; break; + case TEAM_HUMANS: teamChar = 'H'; break; + case TEAM_NONE: teamChar = 'L'; break; default: return; } @@ -1665,11 +1665,11 @@ void G_SendGameStat( pTeam_t team ) else ping = cl->ps.ping < 999 ? cl->ps.ping : 999; - switch( cl->ps.stats[ STAT_PTEAM ] ) + switch( cl->ps.stats[ STAT_TEAM ] ) { - case PTE_ALIENS: teamChar = 'A'; break; - case PTE_HUMANS: teamChar = 'H'; break; - case PTE_NONE: teamChar = 'S'; break; + case TEAM_ALIENS: teamChar = 'A'; break; + case TEAM_HUMANS: teamChar = 'H'; break; + case TEAM_NONE: teamChar = 'S'; break; default: return; } @@ -1725,7 +1725,7 @@ void LogExit( const char *string ) cl = &level.clients[ level.sortedClients[ i ] ]; - if( cl->ps.stats[ STAT_PTEAM ] == PTE_NONE ) + if( cl->ps.stats[ STAT_TEAM ] == TEAM_NONE ) continue; if( cl->pers.connected == CON_CONNECTING ) @@ -1790,7 +1790,7 @@ void CheckIntermissionExit( void ) if( cl->pers.connected != CON_CONNECTED ) continue; - if( cl->ps.stats[ STAT_PTEAM ] == PTE_NONE ) + if( cl->ps.stats[ STAT_TEAM ] == TEAM_NONE ) continue; if( cl->readyToExit ) @@ -1899,7 +1899,7 @@ void CheckExitRules( void ) { if( level.time - level.startTime >= g_timelimit.integer * 60000 ) { - level.lastWin = PTE_NONE; + level.lastWin = TEAM_NONE; trap_SendServerCommand( -1, "print \"Timelimit hit\n\"" ); trap_SetConfigstring( CS_WINNER, "Stalemate" ); LogExit( "Timelimit hit." ); @@ -1925,7 +1925,7 @@ void CheckExitRules( void ) ( level.numLiveAlienClients == 0 ) ) ) { //humans win - level.lastWin = PTE_HUMANS; + level.lastWin = TEAM_HUMANS; trap_SendServerCommand( -1, "print \"Humans win\n\""); trap_SetConfigstring( CS_WINNER, "Humans Win" ); LogExit( "Humans win." ); @@ -1936,7 +1936,7 @@ void CheckExitRules( void ) ( level.numLiveHumanClients == 0 ) ) ) { //aliens win - level.lastWin = PTE_ALIENS; + level.lastWin = TEAM_ALIENS; trap_SendServerCommand( -1, "print \"Aliens win\n\""); trap_SetConfigstring( CS_WINNER, "Aliens Win" ); LogExit( "Aliens win." ); @@ -1993,9 +1993,9 @@ void G_TeamVote( gentity_t *ent, qboolean voting ) { int cs_offset; - if( ent->client->pers.teamSelection == PTE_HUMANS ) + if( ent->client->pers.teamSelection == TEAM_HUMANS ) cs_offset = 0; - else if( ent->client->pers.teamSelection == PTE_ALIENS ) + else if( ent->client->pers.teamSelection == TEAM_ALIENS ) cs_offset = 1; else return; @@ -2116,9 +2116,9 @@ void CheckTeamVote( int team ) { int cs_offset; - if ( team == PTE_HUMANS ) + if ( team == TEAM_HUMANS ) cs_offset = 0; - else if ( team == PTE_ALIENS ) + else if ( team == TEAM_ALIENS ) cs_offset = 1; else return; @@ -2376,8 +2376,8 @@ void G_RunFrame( int levelTime ) G_CountSpawns( ); G_CalculateBuildPoints( ); G_CalculateStages( ); - G_SpawnClients( PTE_ALIENS ); - G_SpawnClients( PTE_HUMANS ); + G_SpawnClients( TEAM_ALIENS ); + G_SpawnClients( TEAM_HUMANS ); G_CalculateAvgPlayers( ); // see if it is time to end the level @@ -2390,8 +2390,8 @@ void G_RunFrame( int levelTime ) CheckVote( ); // check team votes - CheckTeamVote( PTE_HUMANS ); - CheckTeamVote( PTE_ALIENS ); + CheckTeamVote( TEAM_HUMANS ); + CheckTeamVote( TEAM_ALIENS ); // for tracking changes CheckCvars( ); diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c index 968ba487..72308364 100644 --- a/src/game/g_maprotation.c +++ b/src/game/g_maprotation.c @@ -233,9 +233,9 @@ static qboolean G_ParseMapRotation( mapRotation_t *mr, char **text_p ) break; if( !Q_stricmp( token, "aliens" ) ) - mrc->lastWin = PTE_ALIENS; + mrc->lastWin = TEAM_ALIENS; else if( !Q_stricmp( token, "humans" ) ) - mrc->lastWin = PTE_HUMANS; + mrc->lastWin = TEAM_HUMANS; else { G_Printf( S_COLOR_RED "ERROR: invalid right hand side in expression: %s\n", token ); diff --git a/src/game/g_misc.c b/src/game/g_misc.c index a68eeb86..729fceb6 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -92,7 +92,7 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles ) G_SetClientViewAngle( player, angles ); // kill anything at the destination - if( player->client->sess.sessionTeam != TEAM_SPECTATOR ) + if( player->client->sess.spectatorState == SPECTATOR_NOT ) G_KillBox( player ); // save results of pmove @@ -101,7 +101,7 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles ) // use the precise origin for linking VectorCopy( player->client->ps.origin, player->r.currentOrigin ); - if( player->client->sess.sessionTeam != TEAM_SPECTATOR ) + if( player->client->sess.spectatorState == SPECTATOR_NOT ) trap_LinkEntity (player); } diff --git a/src/game/g_missile.c b/src/game/g_missile.c index f3cc8f64..e85e7cd4 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -139,7 +139,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) } else if( !strcmp( ent->classname, "lockblob" ) ) { - if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { other->client->ps.stats[ STAT_STATE ] |= SS_BLOBLOCKED; other->client->lastLockTime = level.time; @@ -149,7 +149,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) } else if( !strcmp( ent->classname, "slowblob" ) ) { - if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { other->client->ps.stats[ STAT_STATE ] |= SS_SLOWLOCKED; other->client->lastSlowTime = level.time; @@ -178,7 +178,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) ent->nextthink = level.time + FRAMETIME; //only damage humans - if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) returnAfterDamage = qtrue; else return; diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 856f8cd5..1e290706 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -1303,7 +1303,7 @@ void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) if( other->s.eType == ET_BUILDABLE ) return; - if( other->client && other->client->sess.sessionTeam == TEAM_SPECTATOR ) + if( other->client && other->client->sess.spectatorState != SPECTATOR_NOT ) { // if the door is not open and not opening if( ent->parent->moverState != MOVER_1TO2 && @@ -2226,13 +2226,13 @@ void Blocked_Train( gentity_t *self, gentity_t *other ) vec3_t dir; gentity_t *tent; - if( other->biteam == BIT_ALIENS ) + if( other->buildableTeam == TEAM_ALIENS ) { VectorCopy( other->s.origin2, dir ); tent = G_TempEntity( other->s.origin, EV_ALIEN_BUILDABLE_EXPLOSION ); tent->s.eventParm = DirToByte( dir ); } - else if( other->biteam == BIT_HUMANS ) + else if( other->buildableTeam == TEAM_HUMANS ) { VectorSet( dir, 0.0f, 0.0f, 1.0f ); tent = G_TempEntity( other->s.origin, EV_HUMAN_BUILDABLE_EXPLOSION ); diff --git a/src/game/g_ptr.c b/src/game/g_ptr.c index 898ad7f5..87d8b2da 100644 --- a/src/game/g_ptr.c +++ b/src/game/g_ptr.c @@ -62,7 +62,7 @@ void G_UpdatePTRConnection( gclient_t *client ) if( client && client->pers.connection ) { client->pers.connection->clientTeam = client->pers.teamSelection; - if( client->pers.teamSelection == PTE_NONE ) + if( client->pers.teamSelection == TEAM_NONE ) client->pers.connection->clientCredit = client->pers.credit; else client->pers.connection->clientCredit = client->ps.persistant[ PERS_CREDIT ]; diff --git a/src/game/g_session.c b/src/game/g_session.c index 66ac9980..c5b517ab 100644 --- a/src/game/g_session.c +++ b/src/game/g_session.c @@ -46,14 +46,10 @@ void G_WriteClientSessionData( gclient_t *client ) const char *s; const char *var; - s = va( "%i %i %i %i %i %i %i %s", - client->sess.sessionTeam, + s = va( "%i %i %i %s", client->sess.spectatorTime, client->sess.spectatorState, client->sess.spectatorClient, - client->sess.wins, - client->sess.losses, - client->sess.teamLeader, BG_ClientListString( &client->sess.ignoreList ) ); @@ -73,30 +69,22 @@ void G_ReadSessionData( gclient_t *client ) { char s[ MAX_STRING_CHARS ]; const char *var; - int teamLeader; int spectatorState; - int sessionTeam; var = va( "session%i", client - level.clients ); trap_Cvar_VariableStringBuffer( var, s, sizeof(s) ); // FIXME: should be using BG_ClientListParse() for ignoreList, but // bg_lib.c's sscanf() currently lacks %s - sscanf( s, "%i %i %i %i %i %i %i %x%x", - &sessionTeam, + sscanf( s, "%i %i %i %x%x", &client->sess.spectatorTime, &spectatorState, &client->sess.spectatorClient, - &client->sess.wins, - &client->sess.losses, - &teamLeader, &client->sess.ignoreList.hi, &client->sess.ignoreList.lo ); - client->sess.sessionTeam = (team_t)sessionTeam; client->sess.spectatorState = (spectatorState_t)spectatorState; - client->sess.teamLeader = (qboolean)teamLeader; } @@ -119,15 +107,15 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) if( value[ 0 ] == 's' ) { // a willing spectator, not a waiting-in-line - sess->sessionTeam = TEAM_SPECTATOR; + sess->spectatorState = SPECTATOR_FREE; } else { if( g_maxGameClients.integer > 0 && level.numNonSpectatorClients >= g_maxGameClients.integer ) - sess->sessionTeam = TEAM_SPECTATOR; + sess->spectatorState = SPECTATOR_FREE; else - sess->sessionTeam = TEAM_FREE; + sess->spectatorState = SPECTATOR_NOT; } sess->spectatorState = SPECTATOR_FREE; diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c index 4cb3d991..3ac6a322 100644 --- a/src/game/g_svcmds.c +++ b/src/game/g_svcmds.c @@ -556,18 +556,18 @@ static void Svcmd_AdmitDefeat_f( void ) } trap_Argv( 1, teamNum, sizeof( teamNum ) ); team = atoi( teamNum ); - if( team == PTE_ALIENS || teamNum[ 0 ] == 'a' ) + if( team == TEAM_ALIENS || teamNum[ 0 ] == 'a' ) { - level.surrenderTeam = PTE_ALIENS; - G_BaseSelfDestruct( PTE_ALIENS ); - G_TeamCommand( PTE_ALIENS, "cp \"Hivemind Link Broken\" 1"); + level.surrenderTeam = TEAM_ALIENS; + G_BaseSelfDestruct( TEAM_ALIENS ); + G_TeamCommand( TEAM_ALIENS, "cp \"Hivemind Link Broken\" 1"); trap_SendServerCommand( -1, "print \"Alien team has admitted defeat\n\"" ); } - else if( team == PTE_HUMANS || teamNum[ 0 ] == 'h' ) + else if( team == TEAM_HUMANS || teamNum[ 0 ] == 'h' ) { - level.surrenderTeam = PTE_HUMANS; - G_BaseSelfDestruct( PTE_HUMANS ); - G_TeamCommand( PTE_HUMANS, "cp \"Life Support Terminated\" 1"); + level.surrenderTeam = TEAM_HUMANS; + G_BaseSelfDestruct( TEAM_HUMANS ); + G_TeamCommand( TEAM_HUMANS, "cp \"Life Support Terminated\" 1"); trap_SendServerCommand( -1, "print \"Human team has admitted defeat\n\"" ); } else @@ -691,7 +691,7 @@ qboolean ConsoleCommand( void ) if( !Q_stricmp( cmd, "evacuation" ) ) { trap_SendServerCommand( -1, "print \"Evacuation ordered\n\"" ); - level.lastWin = PTE_NONE; + level.lastWin = TEAM_NONE; trap_SetConfigstring( CS_WINNER, "Evacuation" ); LogExit( "Evacuation." ); return qtrue; diff --git a/src/game/g_target.c b/src/game/g_target.c index dfb9c7e2..b2c2d9ab 100644 --- a/src/game/g_target.c +++ b/src/game/g_target.c @@ -92,9 +92,9 @@ void Use_Target_Print( gentity_t *ent, gentity_t *other, gentity_t *activator ) if( ent->spawnflags & 3 ) { if( ent->spawnflags & 1 ) - G_TeamCommand( PTE_HUMANS, va( "cp \"%s\"", ent->message ) ); + G_TeamCommand( TEAM_HUMANS, va( "cp \"%s\"", ent->message ) ); if( ent->spawnflags & 2 ) - G_TeamCommand( PTE_ALIENS, va( "cp \"%s\"", ent->message ) ); + G_TeamCommand( TEAM_ALIENS, va( "cp \"%s\"", ent->message ) ); return; } @@ -232,11 +232,11 @@ if RANDOM is checked, only one of the targets will be fired, not all of them void target_relay_use( gentity_t *self, gentity_t *other, gentity_t *activator ) { if( ( self->spawnflags & 1 ) && activator->client && - activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + activator->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; if( ( self->spawnflags & 2 ) && activator->client && - activator->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + activator->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) return; if( self->spawnflags & 4 ) diff --git a/src/game/g_team.c b/src/game/g_team.c index 85582f19..c4db7dcf 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -170,8 +170,8 @@ void TeamplayInfoMessage( gentity_t *ent ) { player = g_entities + level.sortedClients[ i ]; - if( player->inuse && player->client->sess.sessionTeam == - ent->client->sess.sessionTeam ) + if( player->inuse && player->client->ps.stats[ STAT_TEAM ] == + ent->client->ps.stats[ STAT_TEAM ] ) clients[ cnt++ ] = level.sortedClients[ i ]; } @@ -186,8 +186,8 @@ void TeamplayInfoMessage( gentity_t *ent ) { player = g_entities + i; - if( player->inuse && player->client->sess.sessionTeam == - ent->client->sess.sessionTeam ) + if( player->inuse && player->client->ps.stats[ STAT_TEAM ] == + ent->client->ps.stats[ STAT_TEAM ] ) { h = player->client->ps.stats[ STAT_HEALTH ]; @@ -228,8 +228,8 @@ void CheckTeamStatus( void ) if( ent->client->pers.connected != CON_CONNECTED ) continue; - if( ent->inuse && ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS || - ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ) + if( ent->inuse && ( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS || + ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) ) { loc = Team_GetLocation( ent ); @@ -247,8 +247,8 @@ void CheckTeamStatus( void ) if( ent->client->pers.connected != CON_CONNECTED ) continue; - if( ent->inuse && ( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS || - ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ) + if( ent->inuse && ( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS || + ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) ) TeamplayInfoMessage( ent ); } } diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index 18af97c0..7e208667 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -54,11 +54,11 @@ void multi_trigger( gentity_t *ent, gentity_t *activator ) if( activator->client ) { if( ( ent->spawnflags & 1 ) && - activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + activator->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; if( ( ent->spawnflags & 2 ) && - activator->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + activator->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) return; } @@ -283,7 +283,7 @@ void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace // Spectators only? if( ( self->spawnflags & 1 ) && - other->client->sess.sessionTeam != TEAM_SPECTATOR ) + other->client->sess.spectatorState == SPECTATOR_NOT ) return; @@ -489,7 +489,7 @@ G_Checktrigger_stages Called when stages change =============== */ -void G_Checktrigger_stages( pTeam_t team, stage_t stage ) +void G_Checktrigger_stages( team_t team, stage_t stage ) { int i; gentity_t *ent; @@ -694,7 +694,7 @@ qboolean trigger_class_match( gentity_t *self, gentity_t *activator ) //otherwise check against the list for( i = 0; self->cTriggers[ i ] != PCL_NONE; i++ ) { - if( activator->client->ps.stats[ STAT_PCLASS ] == self->cTriggers[ i ] ) + if( activator->client->ps.stats[ STAT_CLASS ] == self->cTriggers[ i ] ) return qtrue; } } @@ -713,7 +713,7 @@ void trigger_class_trigger( gentity_t *self, gentity_t *activator ) if( !activator->client ) return; - if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + if( activator->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) return; if( self->s.eFlags & EF_NODRAW ) @@ -853,7 +853,7 @@ void trigger_equipment_trigger( gentity_t *self, gentity_t *activator ) if( !activator->client ) return; - if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( activator->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; if( self->s.eFlags & EF_NODRAW ) @@ -1078,7 +1078,7 @@ void trigger_ammo_touch( gentity_t *self, gentity_t *other, trace_t *trace ) if( !other->client ) return; - if( other->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( other->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS ) return; if( self->timestamp > level.time ) diff --git a/src/game/g_utils.c b/src/game/g_utils.c index 5280432b..2d2690d4 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -152,7 +152,7 @@ G_TeamCommand Broadcasts a command to only a specific team ================ */ -void G_TeamCommand( pTeam_t team, char *cmd ) +void G_TeamCommand( team_t team, char *cmd ) { int i; @@ -161,7 +161,7 @@ void G_TeamCommand( pTeam_t team, char *cmd ) if( level.clients[ i ].pers.connected == CON_CONNECTED ) { if( level.clients[ i ].pers.teamSelection == team || - ( level.clients[ i ].pers.teamSelection == PTE_NONE && + ( level.clients[ i ].pers.teamSelection == TEAM_NONE && G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) ) trap_SendServerCommand( i, cmd ); } diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 7e682628..b420e876 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -807,7 +807,7 @@ void cancelBuildFire( gentity_t *ent ) } // Construction kit repair - if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) { AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); VectorMA( ent->client->ps.origin, 100, forward, end ); @@ -817,7 +817,7 @@ void cancelBuildFire( gentity_t *ent ) traceEnt = &g_entities[ tr.entityNum ]; if( tr.fraction < 1.0f && traceEnt->spawned && traceEnt->health > 0 && - traceEnt->s.eType == ET_BUILDABLE && traceEnt->biteam == BIT_HUMANS ) + traceEnt->s.eType == ET_BUILDABLE && traceEnt->buildableTeam == TEAM_HUMANS ) { if( ent->client->ps.stats[ STAT_MISC ] > 0 ) { @@ -933,13 +933,13 @@ qboolean CheckVenomAttack( gentity_t *ent ) if( traceEnt->spawned ) return qfalse; - if( traceEnt->biteam == BIT_ALIENS ) + if( traceEnt->buildableTeam == TEAM_ALIENS ) return qfalse; } if( traceEnt->client ) { - if( traceEnt->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( traceEnt->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) return qfalse; if( traceEnt->client->ps.stats[ STAT_HEALTH ] <= 0 ) return qfalse; @@ -990,7 +990,7 @@ void CheckGrabAttack( gentity_t *ent ) if( traceEnt->client ) { - if( traceEnt->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( traceEnt->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) return; if( traceEnt->client->ps.stats[ STAT_HEALTH ] <= 0 ) @@ -1047,7 +1047,7 @@ void poisonCloud( gentity_t *ent ) humanPlayer = &g_entities[ entityList[ i ] ]; if( humanPlayer->client && - humanPlayer->client->pers.teamSelection == PTE_HUMANS ) + humanPlayer->client->pers.teamSelection == TEAM_HUMANS ) { trap_Trace( &tr, muzzle, NULL, NULL, humanPlayer->s.origin, humanPlayer->s.number, CONTENTS_SOLID ); @@ -1129,9 +1129,9 @@ void G_UpdateZaps( gentity_t *ent ) enemy = &g_entities[ entityList[ i ] ]; if( ( ( enemy->client && - enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) || + enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) || ( enemy->s.eType == ET_BUILDABLE && - BG_FindTeamForBuildable( enemy->s.modelindex ) == BIT_HUMANS ) ) && + BG_FindTeamForBuildable( enemy->s.modelindex ) == TEAM_HUMANS ) ) && enemy->health > 0 ) { @@ -1340,7 +1340,7 @@ void G_CrushAttack( gentity_t *ent, gentity_t *victim ) return; // Deal velocity based damage to target - jump = BG_FindJumpMagnitudeForClass( ent->client->ps.stats[ STAT_PCLASS ] ); + jump = BG_FindJumpMagnitudeForClass( ent->client->ps.stats[ STAT_CLASS ] ); damage = ( ent->client->pmext.fallVelocity + jump ) * -LEVEL4_CRUSH_DAMAGE_PER_V; diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index e01f1b8f..48eea7db 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -170,7 +170,7 @@ typedef struct { const char *text; buildable_t buildable; - pClass_t pclass; + class_t pclass; weapon_t weapon; upgrade_t upgrade; } v; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 11971f2a..5907a3ef 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1605,11 +1605,11 @@ static void UI_DrawInfoPane( menuItem_t *item, rectDef_t *rect, float text_x, fl switch( BG_FindTeamForBuildable( item->v.buildable ) ) { - case BIT_ALIENS: + case TEAM_ALIENS: string = "Sentience"; break; - case BIT_HUMANS: + case TEAM_HUMANS: string = "Power"; break; @@ -1941,7 +1941,7 @@ static qboolean UI_OwnerDrawVisible( int flags ) { qboolean vis = qtrue; uiClientState_t cs; - pTeam_t team; + team_t team; char info[ MAX_INFO_STRING ]; trap_GetClientState( &cs ); @@ -1953,7 +1953,7 @@ static qboolean UI_OwnerDrawVisible( int flags ) { if( flags & UI_SHOW_NOTSPECTATING ) { - if( team == PTE_NONE ) + if( team == TEAM_NONE ) vis = qfalse; flags &= ~UI_SHOW_NOTSPECTATING; @@ -1977,12 +1977,12 @@ static qboolean UI_OwnerDrawVisible( int flags ) if( flags & UI_SHOW_TEAMVOTEACTIVE ) { - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { if( !trap_Cvar_VariableValue( "ui_alienTeamVoteActive" ) ) vis = qfalse; } - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) { if( !trap_Cvar_VariableValue( "ui_humanTeamVoteActive" ) ) vis = qfalse; @@ -1993,12 +1993,12 @@ static qboolean UI_OwnerDrawVisible( int flags ) if( flags & UI_SHOW_CANTEAMVOTE ) { - if( team == PTE_ALIENS ) + if( team == TEAM_ALIENS ) { if( trap_Cvar_VariableValue( "ui_alienTeamVoteActive" ) ) vis = qfalse; } - else if( team == PTE_HUMANS ) + else if( team == TEAM_HUMANS ) { if( trap_Cvar_VariableValue( "ui_humanTeamVoteActive" ) ) vis = qfalse; @@ -2162,7 +2162,7 @@ UI_AddClass =============== */ -static void UI_AddClass( pClass_t class ) +static void UI_AddClass( class_t class ) { uiInfo.alienClassList[ uiInfo.alienClassCount ].text = @@ -2313,7 +2313,7 @@ static void UI_LoadHumanArmouryBuys( void ) for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) { - if( BG_FindTeamForWeapon( i ) == WUT_HUMANS && + if( BG_FindTeamForWeapon( i ) == TEAM_HUMANS && BG_FindPurchasableForWeapon( i ) && BG_FindStagesForWeapon( i, stage ) && BG_WeaponIsAllowed( i ) && @@ -2335,7 +2335,7 @@ static void UI_LoadHumanArmouryBuys( void ) for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) { - if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS && + if( BG_FindTeamForUpgrade( i ) == TEAM_HUMANS && BG_FindPurchasableForUpgrade( i ) && BG_FindStagesForUpgrade( i, stage ) && BG_UpgradeIsAllowed( i ) && @@ -2474,7 +2474,7 @@ static void UI_LoadAlienBuilds( void ) for( i = BA_NONE + 1; i < BA_NUM_BUILDABLES; i++ ) { - if( BG_FindTeamForBuildable( i ) == BIT_ALIENS && + if( BG_FindTeamForBuildable( i ) == TEAM_ALIENS && BG_FindBuildWeaponForBuildable( i ) & uiInfo.weapons && BG_FindStagesForBuildable( i, stage ) && BG_BuildableIsAllowed( i ) ) @@ -2510,7 +2510,7 @@ static void UI_LoadHumanBuilds( void ) for( i = BA_NONE + 1; i < BA_NUM_BUILDABLES; i++ ) { - if( BG_FindTeamForBuildable( i ) == BIT_HUMANS && + if( BG_FindTeamForBuildable( i ) == TEAM_HUMANS && BG_FindBuildWeaponForBuildable( i ) & uiInfo.weapons && BG_FindStagesForBuildable( i, stage ) && BG_BuildableIsAllowed( i ) ) |