summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-09-03 20:50:44 +0000
committerTim Angus <tim@ngus.net>2003-09-03 20:50:44 +0000
commitadbcbeb9156141e02d182d00d91330f3f523664a (patch)
tree242f7975d4e671b897937c1a96053eb01e79889d
parent4b7492531a70a97c4bfbd211564cfd0a192c58d6 (diff)
* Really fixed the creep bug
* Usable buildable icon is only displayed on reactors and repeaters if you have an energy weapon
-rw-r--r--src/cgame/cg_buildable.c4
-rw-r--r--src/cgame/cg_draw.c9
-rw-r--r--src/cgame/cg_ents.c14
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/game/g_buildable.c8
5 files changed, 13 insertions, 24 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;
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 69fcf330..6ff424f0 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -416,7 +416,7 @@ void ASpawn_Blast( gentity_t *self )
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
- self->s.modelindex = 0; //don't draw the model once its destroyed
+ self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
self->timestamp = level.time;
self->think = ASpawn_Melt;
@@ -632,7 +632,7 @@ void ABarricade_Blast( gentity_t *self )
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
- self->s.modelindex = 0; //don't draw the model once its destroyed
+ self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
self->timestamp = level.time;
self->think = A_CreepRecede;
@@ -925,7 +925,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
- self->s.modelindex = 0; //don't draw the model once its destroyed
+ self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
self->timestamp = level.time;
self->think = ASpawn_Melt;
@@ -1733,7 +1733,7 @@ void HSpawn_Blast( gentity_t *self )
dir[ 0 ] = dir[ 1 ] = 0;
dir[ 2 ] = 1;
- self->s.modelindex = 0; //don't draw the model once its destroyed
+ self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed
G_AddEvent( self, EV_BUILDABLE_EXPLOSION, DirToByte( dir ) );
self->timestamp = level.time;