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; vec3_t forward, right;
trace_t trace; trace_t trace;
int i; int i;
vec3_t oldgoal;
vec3_t angles; vec3_t angles;
// is our chase target gone? // is our chase target gone?
@ -25,7 +24,6 @@ void UpdateChaseCam(edict_t *ent)
targ = ent->client->chase_target; targ = ent->client->chase_target;
VectorCopy(targ->s.origin, ownerv); VectorCopy(targ->s.origin, ownerv);
VectorCopy(ent->s.origin, oldgoal);
ownerv[2] += targ->viewheight; 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 ) 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->gravity = 1.0;
cargo->movetype = MOVETYPE_PUSHABLE; cargo->movetype = MOVETYPE_PUSHABLE;
cargo->velocity[2] = 0; cargo->velocity[2] = 0;
@ -377,8 +374,6 @@ void Crane_blocked (edict_t *self, edict_t *other)
if (other) if (other)
{ {
// Lazarus: Some of our ents don't have origin near the model // 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); VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other); BecomeExplosion1 (other);
} }

View file

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

View file

@ -1248,7 +1248,6 @@ void barrel_explode (edict_t *self)
{ {
vec3_t org; vec3_t org;
float spd; float spd;
vec3_t save;
vec3_t size; vec3_t size;
if (self->gib_type == GIB_BARREL) if (self->gib_type == GIB_BARREL)
@ -1256,7 +1255,6 @@ void barrel_explode (edict_t *self)
func_explosive_explode(self); func_explosive_explode(self);
return; return;
} }
VectorCopy (self->s.origin, save);
VectorMA (self->absmin, 0.5, self->size, self->s.origin); 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); 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. // shotchance: 0-1, chance they'll take the shot if it's clear.
qboolean blocked_checkshot (edict_t *self, float shotChance) qboolean blocked_checkshot (edict_t *self, float shotChance)
{ {
qboolean playerVisible;
if(!self->enemy) if(!self->enemy)
return false; return false;
@ -82,7 +80,6 @@ qboolean blocked_checkshot (edict_t *self, float shotChance)
} }
} }
playerVisible = visible (self, self->enemy);
return false; return false;
} }
@ -478,8 +475,7 @@ qboolean monsterlost_checkhint (edict_t *self)
edict_t *closest; edict_t *closest;
float closest_range = 1000000; float closest_range = 1000000;
edict_t *start, *destination; edict_t *start, *destination;
int field; int count1=0, count2=0, count4=0, count5=0;
int count1=0, count2=0, count3=0, count4=0, count5=0;
float r; float r;
int i; int i;
qboolean hint_path_represented[MAX_HINT_CHAINS]; qboolean hint_path_represented[MAX_HINT_CHAINS];
@ -504,8 +500,6 @@ qboolean monsterlost_checkhint (edict_t *self)
monster_pathchain = NULL; monster_pathchain = NULL;
field = FOFS(classname);
// find all the hint_paths. // find all the hint_paths.
// FIXME - can we not do this every time? // FIXME - can we not do this every time?
for (i=0; i < num_hint_paths; i++) for (i=0; i < num_hint_paths; i++)
@ -617,7 +611,6 @@ qboolean monsterlost_checkhint (edict_t *self)
count1 = 0; count1 = 0;
count2 = 0; count2 = 0;
count3 = 0;
count4 = 0; count4 = 0;
count5 = 0; count5 = 0;
@ -925,7 +918,6 @@ void InitHintPaths (void)
{ {
edict_t *e, *current; edict_t *e, *current;
int field, i, count2; int field, i, count2;
qboolean errors = false;
hint_paths_present = 0; 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", 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); vtos (e->s.origin), e->target, e->targetname);
errors = true;
} }
else else
{ {
@ -978,7 +969,6 @@ void InitHintPaths (void)
vtos (current->s.origin), num_hint_paths, current->target); vtos (current->s.origin), num_hint_paths, current->target);
hint_path_start[i]->hint_chain = NULL; hint_path_start[i]->hint_chain = NULL;
count2 = 0; count2 = 0;
errors = true;
continue; continue;
} }
while (e) while (e)
@ -989,7 +979,6 @@ void InitHintPaths (void)
vtos (e->s.origin), num_hint_paths, e->targetname); vtos (e->s.origin), num_hint_paths, e->targetname);
hint_path_start[i]->hint_chain = NULL; hint_path_start[i]->hint_chain = NULL;
count2 = 0; count2 = 0;
errors = true;
break; break;
} }
count2++; count2++;

View file

@ -32,7 +32,7 @@ solid_edge items only clip against bsp models.
void other_FallingDamage (edict_t *ent) void other_FallingDamage (edict_t *ent)
{ {
float delta; float delta;
float fall_time, fall_value; float fall_value;
int damage; int damage;
vec3_t dir; vec3_t dir;
@ -69,8 +69,6 @@ void other_FallingDamage (edict_t *ent)
fall_value = delta * 0.5; fall_value = delta * 0.5;
if (fall_value > 40) fall_value = 40; 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 if (delta > MAX_SAFE_FALLDIST) //CW: reduced safe falling distance, and replaced hardcoded value
{ {
ent->pain_debounce_time = level.time; // no normal pain sound 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; int i, e;
edict_t *check, *block; edict_t *check, *block;
vec3_t mins, maxs;
pushed_t *p; pushed_t *p;
vec3_t org, org2, org_check, forward, right, up; vec3_t org, org2, org_check, forward, right, up;
vec3_t move2={0,0,0}; 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; 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 // Lazarus: temp turn indicates whether riders
// should rotate with the pusher // should rotate with the pusher
if(pusher->turn_rider && turn_rider->value) if(pusher->turn_rider && turn_rider->value)

View file

@ -1011,8 +1011,6 @@ void tracktrain_blocked (edict_t *self, edict_t *other)
if (other) if (other)
{ {
// Some of our ents don't have origin near the model // 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); VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1 (other); 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 ) void LookAhead( edict_t *train, vec3_t point, float dist )
{ {
float originalDist = dist;
float length; float length;
vec3_t v; vec3_t v;
edict_t *path; 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) void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{ {
trace_t tr;
vec_t dist; vec_t dist;
vec3_t dir, forward, left, up, end, start; 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 // Then trigger only fires if looking at TARGET, not trigger bbox
edict_t *target; edict_t *target;
int num_triggered=0; int num_triggered=0;
edict_t *what;
vec3_t endpos; vec3_t endpos;
target = G_Find(NULL,FOFS(targetname),self->target); target = G_Find(NULL,FOFS(targetname),self->target);
while(target && !num_triggered) while(target && !num_triggered)
{ {
what = LookingAt(other,0,endpos,NULL);
if(target->inuse && (LookingAt(other,0,NULL,NULL) == target)) if(target->inuse && (LookingAt(other,0,NULL,NULL) == target))
{ {
num_triggered++; num_triggered++;
@ -1463,8 +1460,6 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
dist = VectorLength(dir); dist = VectorLength(dir);
VectorMA(start,dist,forward,end); 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 // See if we're looking at origin, within bleft, tright
// FIXME: The following is more or less accurate if the // FIXME: The following is more or less accurate if the
// bleft-tright box is roughly a cube. If it's considerably // 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; vec3_t temp;
float chance; float chance;
trace_t tr; trace_t tr;
qboolean enemy_infront;
int enemy_range; int enemy_range;
float enemy_yaw; float enemy_yaw;
@ -585,7 +584,6 @@ qboolean Boss2_CheckAttack (edict_t *self)
return false; return false;
} }
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy); enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp); VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp); enemy_yaw = vectoyaw(temp);

View file

@ -544,12 +544,6 @@ void jorg_firebullet (edict_t *self)
void jorg_attack(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) if (random() <= 0.75)
{ {
gi.sound (self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM,0); gi.sound (self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM,0);
@ -610,7 +604,6 @@ qboolean Jorg_CheckAttack (edict_t *self)
vec3_t temp; vec3_t temp;
float chance; float chance;
trace_t tr; trace_t tr;
qboolean enemy_infront;
int enemy_range; int enemy_range;
float enemy_yaw; float enemy_yaw;
@ -629,7 +622,6 @@ qboolean Jorg_CheckAttack (edict_t *self)
return false; return false;
} }
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy); enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp); VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(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) void makron_attack(edict_t *self)
{ {
vec3_t vec;
float range;
float r; float r;
r = random(); r = random();
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (r <= 0.3) if (r <= 0.3)
self->monsterinfo.currentmove = &makron_move_attack3; self->monsterinfo.currentmove = &makron_move_attack3;
else if (r <= 0.6) else if (r <= 0.6)
@ -735,7 +729,6 @@ qboolean Makron_CheckAttack (edict_t *self)
vec3_t temp; vec3_t temp;
float chance; float chance;
trace_t tr; trace_t tr;
qboolean enemy_infront;
int enemy_range; int enemy_range;
float enemy_yaw; float enemy_yaw;
@ -754,7 +747,6 @@ qboolean Makron_CheckAttack (edict_t *self)
return false; return false;
} }
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy); enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp); VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp); enemy_yaw = vectoyaw(temp);

View file

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