diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 9 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 14 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 |
4 files changed, 9 insertions, 20 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 7e03ae6d..f185b026 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -785,14 +785,14 @@ void CG_Buildable( centity_t *cent ) vec3_t refNormal = { 0.0f, 0.0f, 1.0f }; float rotAngle; trace_t tr; - buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex2 ); + buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex ); //must be before EF_NODRAW check if( team == BIT_ALIENS ) CG_Creep( cent ); // if set to invisible, skip - if( !es->modelindex || ( es->eFlags & EF_NODRAW ) ) + if( es->eFlags & EF_NODRAW ) return; memset ( &ent, 0, sizeof( ent ) ); diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index ea74e49f..d9aff288 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -982,9 +982,14 @@ 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.nearbyCorpse ) + if( es->eType == ET_BUILDABLE && BG_FindUsableForBuildable( 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 ) && + ( !BG_FindUsesEnergyForWeapon( cg.snap->ps.weapon ) || + BG_FindInfinteAmmoForWeapon( cg.snap->ps.weapon ) ) ) + return; + trap_R_SetColor( color ); CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); trap_R_SetColor( NULL ); diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 9b57e627..9128597c 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -990,7 +990,6 @@ void CG_AddPacketEntities( void ) cg.ep.numHumanBuildables = 0; cg.ep.numAlienClients = 0; cg.ep.numHumanClients = 0; - cg.nearbyCorpse = qfalse; for( num = 0 ; num < cg.snap->numEntities ; num++ ) { @@ -1026,19 +1025,6 @@ void CG_AddPacketEntities( void ) cg.ep.numHumanClients++; } } - else if( cent->currentState.eType == ET_CORPSE ) - { -#define INFEST_RADIUS 64.0f - - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS && - Distance( cg.refdef.vieworg, cent->lerpOrigin ) < INFEST_RADIUS ) - { - if( cent->currentState.eType == ET_CORPSE && - ( cent->currentState.powerups == cg.predictedPlayerState.clientNum || - cent->currentState.powerups == 65535 ) ) - cg.nearbyCorpse = qtrue; - } - } } //Com_Printf( "%d %d\n", cgIP.numAlienClients, cgIP.numHumanClients ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 4fc20bd3..df0366d0 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -747,8 +747,6 @@ typedef struct consoleLine_t consoleLines[ MAX_CONSOLE_LINES ]; int numConsoleLines; qboolean consoleValid; - - qboolean nearbyCorpse; } cg_t; |