Skip to content

Commit

Permalink
* Silence some set-but-unused variable warnings. There are still more…
Browse files Browse the repository at this point in the history
…. Many others will be handled in the next upstream merge.
  • Loading branch information
cschwarz committed Aug 7, 2011
1 parent 3ddd475 commit f608fb2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 49 deletions.
2 changes: 0 additions & 2 deletions src/cgame/cg_buildable.c
Expand Up @@ -1233,7 +1233,6 @@ void CG_Buildable( centity_t *cent )
team_t team = BG_Buildable( es->modelindex )->team;
float scale;
int health;
float healthScale;

//must be before EF_NODRAW check
if( team == TEAM_ALIENS )
Expand Down Expand Up @@ -1450,7 +1449,6 @@ void CG_Buildable( centity_t *cent )
}

health = es->generic1;
healthScale = (float)health / BG_Buildable( es->modelindex )->health;

if( health < cent->lastBuildableHealth &&
( es->eFlags & EF_B_SPAWNED ) )
Expand Down
2 changes: 0 additions & 2 deletions src/game/g_admin.c
Expand Up @@ -482,7 +482,6 @@ static void admin_writeconfig( void )
{
fileHandle_t f;
int t;
char levels[ MAX_STRING_CHARS ] = {""};
g_admin_admin_t *a;
g_admin_level_t *l;
g_admin_ban_t *b;
Expand Down Expand Up @@ -555,7 +554,6 @@ static void admin_writeconfig( void )
}
for( c = g_admin_commands; c; c = c->next )
{
levels[ 0 ] = '\0';
trap_FS_Write( "[command]\n", 10, f );
trap_FS_Write( "command = ", 10, f );
admin_writeconfig_string( c->command, f );
Expand Down
8 changes: 1 addition & 7 deletions src/game/g_buildable.c
Expand Up @@ -932,12 +932,8 @@ Think function for Alien Overmind
void AOvermind_Think( gentity_t *self )
{
vec3_t range = { OVERMIND_ATTACK_RANGE, OVERMIND_ATTACK_RANGE, OVERMIND_ATTACK_RANGE };
vec3_t mins, maxs;
int i;

VectorAdd( self->s.origin, range, maxs );
VectorSubtract( self->s.origin, range, mins );

if( self->spawned && ( self->health > 0 ) )
{
//do some damage
Expand All @@ -947,7 +943,7 @@ void AOvermind_Think( gentity_t *self )
self->timestamp = level.time;
G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse );
}

// just in case an egg finishes building after we tell overmind to stfu
if( level.numAlienSpawns > 0 )
level.overmindMuted = qfalse;
Expand Down Expand Up @@ -3370,7 +3366,6 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
qboolean invert;
int contents;
playerState_t *ps = &ent->client->ps;
int buildPoints;

// Stop all buildables from interacting with traces
G_SetBuildableLinkState( qfalse );
Expand All @@ -3395,7 +3390,6 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
reason = IBE_NORMAL;

contents = trap_PointContents( entity_origin, -1 );
buildPoints = BG_Buildable( buildable )->buildPoints;

if( ( tempReason = G_SufficientBPAvailable( buildable, origin ) ) != IBE_NONE )
reason = tempReason;
Expand Down
5 changes: 1 addition & 4 deletions src/game/g_combat.c
Expand Up @@ -238,7 +238,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
int killer;
int i;
char *killerName, *obit;
float totalDamage = 0.0f;

if( self->client->ps.pm_type == PM_DEAD )
return;
Expand Down Expand Up @@ -319,7 +318,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
}

// give credits for killing this player
totalDamage = G_RewardAttackers( self );
G_RewardAttackers( self );

ScoreboardMessage( self ); // show scores

Expand Down Expand Up @@ -910,7 +909,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
{
gclient_t *client;
int take;
int save;
int asave = 0;
int knockback;

Expand Down Expand Up @@ -1078,7 +1076,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
}

take = damage;
save = 0;

// add to the damage inflicted on a player this frame
// the total will be turned into screen blends and view angle kicks
Expand Down
43 changes: 9 additions & 34 deletions src/game/g_weapon.c
Expand Up @@ -505,11 +505,7 @@ LOCKBLOB

void lockBlobLauncherFire( gentity_t *ent )
{
gentity_t *m;

m = fire_lockblob( ent, muzzle, forward );

// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
fire_lockblob( ent, muzzle, forward );
}

/*
Expand Down Expand Up @@ -540,11 +536,7 @@ BLASTER PISTOL

void blasterFire( gentity_t *ent )
{
gentity_t *m;

m = fire_blaster( ent, muzzle, forward );

// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
fire_blaster( ent, muzzle, forward );
}

/*
Expand All @@ -557,11 +549,7 @@ PULSE RIFLE

void pulseRifleFire( gentity_t *ent )
{
gentity_t *m;

m = fire_pulseRifle( ent, muzzle, forward );

// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
fire_pulseRifle( ent, muzzle, forward );
}

/*
Expand Down Expand Up @@ -595,9 +583,7 @@ GRENADE

void throwGrenade( gentity_t *ent )
{
gentity_t *m;

m = launch_grenade( ent, muzzle, forward );
launch_grenade( ent, muzzle, forward );
}

/*
Expand Down Expand Up @@ -707,13 +693,11 @@ LCChargeFire
*/
void LCChargeFire( gentity_t *ent, qboolean secondary )
{
gentity_t *m;

if( secondary && ent->client->ps.stats[ STAT_MISC ] <= 0 )
m = fire_luciferCannon( ent, muzzle, forward, LCANNON_SECONDARY_DAMAGE,
fire_luciferCannon( ent, muzzle, forward, LCANNON_SECONDARY_DAMAGE,
LCANNON_SECONDARY_RADIUS, LCANNON_SECONDARY_SPEED );
else
m = fire_luciferCannon( ent, muzzle, forward,
fire_luciferCannon( ent, muzzle, forward,
ent->client->ps.stats[ STAT_MISC ] *
LCANNON_DAMAGE / LCANNON_CHARGE_TIME_MAX,
LCANNON_RADIUS, LCANNON_SPEED );
Expand Down Expand Up @@ -873,11 +857,7 @@ void buildFire( gentity_t *ent, dynMenu_t menu )

void slowBlobFire( gentity_t *ent )
{
gentity_t *m;

m = fire_slowBlob( ent, muzzle, forward );

// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
fire_slowBlob( ent, muzzle, forward );
}


Expand Down Expand Up @@ -1335,11 +1315,7 @@ qboolean CheckPounceAttack( gentity_t *ent )

void bounceBallFire( gentity_t *ent )
{
gentity_t *m;

m = fire_bounceBall( ent, muzzle, forward );

// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
fire_bounceBall( ent, muzzle, forward );
}


Expand All @@ -1360,7 +1336,7 @@ void G_ChargeAttack( gentity_t *ent, gentity_t *victim )
{
int damage;
int i;
vec3_t forward, normal;
vec3_t forward;

if( ent->client->ps.stats[ STAT_MISC ] <= 0 ||
!( ent->client->ps.stats[ STAT_STATE ] & SS_CHARGING ) ||
Expand All @@ -1369,7 +1345,6 @@ void G_ChargeAttack( gentity_t *ent, gentity_t *victim )

VectorSubtract( victim->s.origin, ent->s.origin, forward );
VectorNormalize( forward );
VectorNegate( forward, normal );

if( !victim->takedamage )
return;
Expand Down

0 comments on commit f608fb2

Please sign in to comment.