Remove unused variables

src/g_chase.c:10:9: warning: variable ‘oldgoal’ set but not used [-Wunused-but-set-variable]
src/g_crane.c:118:9: warning: variable ‘origin’ set but not used [-Wunused-but-set-variable]
src/g_crane.c:380:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_func.c:101:15: warning: variable ‘sr’ set but not used [-Wunused-but-set-variable]
src/g_func.c:101:11: warning: variable ‘cr’ set but not used [-Wunused-but-set-variable]
src/g_func.c:836:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_func.c:1942:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_func.c:2488:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_func.c:3487:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_func.c:3642:10: warning: variable ‘oldorg’ set but not used [-Wunused-but-set-variable]
src/g_func.c:3790:9: warning: variable ‘origin’ set but not used [-Wunused-but-set-variable]
src/g_misc.c:1251:9: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/g_newai.c:36:11: warning: variable ‘playerVisible’ set but not used [-Wunused-but-set-variable]
src/g_newai.c:482:28: warning: variable ‘count3’ set but not used [-Wunused-but-set-variable]
src/g_newai.c:481:8: warning: variable ‘field’ set but not used [-Wunused-but-set-variable]
src/g_newai.c:928:11: warning: variable ‘errors’ set but not used [-Wunused-but-set-variable]
src/g_phys.c:35:10: warning: variable ‘fall_time’ set but not used [-Wunused-but-set-variable]
src/g_phys.c:891:16: warning: variable ‘maxs’ set but not used [-Wunused-but-set-variable]
src/g_phys.c:891:10: warning: variable ‘mins’ set but not used [-Wunused-but-set-variable]
src/g_trigger.c:1423:12: warning: variable ‘what’ set but not used [-Wunused-but-set-variable]
src/g_trigger.c:1402:10: warning: variable ‘tr’ set but not used [-Wunused-but-set-variable]
src/g_tracktrain.c:1014:11: warning: variable ‘save’ set but not used [-Wunused-but-set-variable]
src/m_boss2.c:566:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/m_boss32.c:596:8: warning: variable ‘range’ set but not used [-Wunused-but-set-variable]
src/m_boss32.c:738:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/m_boss31.c:548:8: warning: variable ‘range’ set but not used [-Wunused-but-set-variable]
src/m_boss31.c:613:11: warning: variable ‘enemy_infront’ set but not used [-Wunused-but-set-variable]
src/p_hud.c:157:7: warning: variable ‘picnum’ set but not used [-Wunused-but-set-variable]
This commit is contained in:
Denis Pauk 2021-01-30 18:44:41 +02:00
parent 52e8de3cb5
commit 701b470ded
12 changed files with 267 additions and 339 deletions

View file

@ -7,7 +7,6 @@ void UpdateChaseCam(edict_t *ent)
vec3_t forward, right;
trace_t trace;
int i;
vec3_t oldgoal;
vec3_t angles;
// is our chase target gone?
@ -25,7 +24,6 @@ void UpdateChaseCam(edict_t *ent)
targ = ent->client->chase_target;
VectorCopy(targ->s.origin, ownerv);
VectorCopy(ent->s.origin, oldgoal);
ownerv[2] += targ->viewheight;

View file

@ -115,9 +115,6 @@ void Cargo_Stop (edict_t *ent)
void cargo_blocked (edict_t *cargo, edict_t *obstacle )
{
vec3_t origin;
VectorAdd(obstacle->s.origin,obstacle->origin_offset,origin);
cargo->gravity = 1.0;
cargo->movetype = MOVETYPE_PUSHABLE;
cargo->velocity[2] = 0;
@ -377,8 +374,6 @@ void Crane_blocked (edict_t *self, edict_t *other)
if (other)
{
// Lazarus: Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other);
}

View file

@ -98,12 +98,9 @@ restart:
if (self->turn_rider) {
// Match angular velocities
if (!Q_stricmp(e->classname,"func_rotating")) {
float cr, sr;
float cy, sy;
cy = cos((e->s.angles[1]-delta_angles[1])*M_PI/180);
sy = sin((e->s.angles[1]-delta_angles[1])*M_PI/180);
cr = cos((e->s.angles[2]-delta_angles[2])*M_PI/180);
sr = sin((e->s.angles[2]-delta_angles[2])*M_PI/180);
if (e->movedir[0] > 0) {
e->s.angles[1] = delta_angles[1];
} else if (e->movedir[1] > 0) {
@ -833,8 +830,6 @@ void plat_blocked (edict_t *self, edict_t *other)
if (other)
{
// Lazarus: Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other);
}
@ -1939,8 +1934,6 @@ void door_blocked (edict_t *self, edict_t *other)
if (other)
{
// Lazarus: Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
@ -2485,8 +2478,6 @@ void train_blocked (edict_t *self, edict_t *other)
if (other)
{
// Lazarus: Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other);
}
@ -3484,8 +3475,6 @@ void door_secret_blocked (edict_t *self, edict_t *other)
if (other)
{
// Lazarus: Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other);
}
@ -3639,7 +3628,7 @@ void SP_func_killbox (edict_t *ent)
//
qboolean box_movestep (edict_t *ent, vec3_t move, qboolean relink)
{
vec3_t oldorg, neworg, end;
vec3_t neworg, end;
trace_t trace;
float stepsize;
@ -3647,7 +3636,6 @@ qboolean box_movestep (edict_t *ent, vec3_t move, qboolean relink)
// try the move
VectorAdd (ent->s.origin, ent->origin_offset, origin);
VectorCopy (origin, oldorg);
VectorAdd (origin, move, neworg);
VectorCopy (ent->size, maxs);
VectorScale (maxs, 0.5, maxs);
@ -3787,7 +3775,6 @@ void box_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf
float v11, v12, v21, v22;
int axis;
vec3_t v1, v2, v;
vec3_t origin;
edict_t *bottom, *top;
// if other is another func_pushable, AND self is in
@ -3891,7 +3878,6 @@ void box_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf
}
// if other is a monster or a player and box is on other's head and moving down,
// do impact damage
VectorAdd(self->s.origin,self->origin_offset,origin);
if ( other->client || (other->svflags & SVF_MONSTER) )
{
VectorAdd (self->absmax,self->absmin,v1);

View file

@ -1248,7 +1248,6 @@ void barrel_explode (edict_t *self)
{
vec3_t org;
float spd;
vec3_t save;
vec3_t size;
if (self->gib_type == GIB_BARREL)
@ -1256,7 +1255,6 @@ void barrel_explode (edict_t *self)
func_explosive_explode(self);
return;
}
VectorCopy (self->s.origin, save);
VectorMA (self->absmin, 0.5, self->size, self->s.origin);
T_RadiusDamage (self, self->activator, self->dmg, NULL, self->dmg+40, MOD_BARREL, -0.5);

View file

@ -33,8 +33,6 @@ qboolean parasite_drain_attack_ok (vec3_t start, vec3_t end);
// shotchance: 0-1, chance they'll take the shot if it's clear.
qboolean blocked_checkshot (edict_t *self, float shotChance)
{
qboolean playerVisible;
if(!self->enemy)
return false;
@ -82,7 +80,6 @@ qboolean blocked_checkshot (edict_t *self, float shotChance)
}
}
playerVisible = visible (self, self->enemy);
return false;
}
@ -478,8 +475,7 @@ qboolean monsterlost_checkhint (edict_t *self)
edict_t *closest;
float closest_range = 1000000;
edict_t *start, *destination;
int field;
int count1=0, count2=0, count3=0, count4=0, count5=0;
int count1=0, count2=0, count4=0, count5=0;
float r;
int i;
qboolean hint_path_represented[MAX_HINT_CHAINS];
@ -504,8 +500,6 @@ qboolean monsterlost_checkhint (edict_t *self)
monster_pathchain = NULL;
field = FOFS(classname);
// find all the hint_paths.
// FIXME - can we not do this every time?
for (i=0; i < num_hint_paths; i++)
@ -617,7 +611,6 @@ qboolean monsterlost_checkhint (edict_t *self)
count1 = 0;
count2 = 0;
count3 = 0;
count4 = 0;
count5 = 0;
@ -925,7 +918,6 @@ void InitHintPaths (void)
{
edict_t *e, *current;
int field, i, count2;
qboolean errors = false;
hint_paths_present = 0;
@ -949,7 +941,6 @@ void InitHintPaths (void)
{
gi.dprintf ("Hint path at %s marked as endpoint with both target (%s) and targetname (%s)\n",
vtos (e->s.origin), e->target, e->targetname);
errors = true;
}
else
{
@ -978,7 +969,6 @@ void InitHintPaths (void)
vtos (current->s.origin), num_hint_paths, current->target);
hint_path_start[i]->hint_chain = NULL;
count2 = 0;
errors = true;
continue;
}
while (e)
@ -989,7 +979,6 @@ void InitHintPaths (void)
vtos (e->s.origin), num_hint_paths, e->targetname);
hint_path_start[i]->hint_chain = NULL;
count2 = 0;
errors = true;
break;
}
count2++;

View file

@ -32,7 +32,7 @@ solid_edge items only clip against bsp models.
void other_FallingDamage (edict_t *ent)
{
float delta;
float fall_time, fall_value;
float fall_value;
int damage;
vec3_t dir;
@ -69,8 +69,6 @@ void other_FallingDamage (edict_t *ent)
fall_value = delta * 0.5;
if (fall_value > 40) fall_value = 40;
fall_time = level.time + FALL_TIME;
if (delta > MAX_SAFE_FALLDIST) //CW: reduced safe falling distance, and replaced hardcoded value
{
ent->pain_debounce_time = level.time; // no normal pain sound
@ -888,7 +886,6 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
{
int i, e;
edict_t *check, *block;
vec3_t mins, maxs;
pushed_t *p;
vec3_t org, org2, org_check, forward, right, up;
vec3_t move2={0,0,0};
@ -910,13 +907,6 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
move[i] = 0.125 * (int)temp;
}
// find the bounding box
for (i=0 ; i<3 ; i++)
{
mins[i] = pusher->absmin[i] + move[i];
maxs[i] = pusher->absmax[i] + move[i];
}
// Lazarus: temp turn indicates whether riders
// should rotate with the pusher
if(pusher->turn_rider && turn_rider->value)

View file

@ -1011,8 +1011,6 @@ void tracktrain_blocked (edict_t *self, edict_t *other)
if (other)
{
// Some of our ents don't have origin near the model
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other);
}
@ -1360,7 +1358,6 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
void LookAhead( edict_t *train, vec3_t point, float dist )
{
float originalDist = dist;
float length;
vec3_t v;
edict_t *path;

View file

@ -1399,7 +1399,6 @@ void SP_trigger_bbox (edict_t *ent)
void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
trace_t tr;
vec_t dist;
vec3_t dir, forward, left, up, end, start;
@ -1420,13 +1419,11 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
// Then trigger only fires if looking at TARGET, not trigger bbox
edict_t *target;
int num_triggered=0;
edict_t *what;
vec3_t endpos;
target = G_Find(NULL,FOFS(targetname),self->target);
while(target && !num_triggered)
{
what = LookingAt(other,0,endpos,NULL);
if(target->inuse && (LookingAt(other,0,NULL,NULL) == target))
{
num_triggered++;
@ -1463,8 +1460,6 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
dist = VectorLength(dir);
VectorMA(start,dist,forward,end);
tr = gi.trace(start,vec3_origin,vec3_origin,end,other,MASK_OPAQUE);
// See if we're looking at origin, within bleft, tright
// FIXME: The following is more or less accurate if the
// bleft-tright box is roughly a cube. If it's considerably

View file

@ -563,7 +563,6 @@ qboolean Boss2_CheckAttack (edict_t *self)
vec3_t temp;
float chance;
trace_t tr;
qboolean enemy_infront;
int enemy_range;
float enemy_yaw;
@ -585,7 +584,6 @@ qboolean Boss2_CheckAttack (edict_t *self)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);

View file

@ -544,12 +544,6 @@ void jorg_firebullet (edict_t *self)
void jorg_attack(edict_t *self)
{
vec3_t vec;
float range;
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (random() <= 0.75)
{
gi.sound (self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM,0);
@ -610,7 +604,6 @@ qboolean Jorg_CheckAttack (edict_t *self)
vec3_t temp;
float chance;
trace_t tr;
qboolean enemy_infront;
int enemy_range;
float enemy_yaw;
@ -629,7 +622,6 @@ qboolean Jorg_CheckAttack (edict_t *self)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);

View file

@ -592,16 +592,10 @@ void makron_sight(edict_t *self, edict_t *other)
void makron_attack(edict_t *self)
{
vec3_t vec;
float range;
float r;
r = random();
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (r <= 0.3)
self->monsterinfo.currentmove = &makron_move_attack3;
else if (r <= 0.6)
@ -735,7 +729,6 @@ qboolean Makron_CheckAttack (edict_t *self)
vec3_t temp;
float chance;
trace_t tr;
qboolean enemy_infront;
int enemy_range;
float enemy_yaw;
@ -754,7 +747,6 @@ qboolean Makron_CheckAttack (edict_t *self)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);

View file

@ -154,7 +154,6 @@ void DeathmatchScoreboardMessage (edict_t *ent, edict_t *killer)
int sorted[MAX_CLIENTS];
int sortedscores[MAX_CLIENTS];
int score, total;
int picnum;
int x, y;
gclient_t *cl;
edict_t *cl_ent;
@ -197,7 +196,6 @@ void DeathmatchScoreboardMessage (edict_t *ent, edict_t *killer)
cl = &game.clients[sorted[i]];
cl_ent = g_edicts + 1 + sorted[i];
picnum = gi.imageindex ("i_fixme");
x = (i>=6) ? 160 : 0;
y = 32 + 32 * (i%6);