Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings
This commit is contained in:
parent
1ea7ab1f42
commit
23f6fd1633
85 changed files with 246 additions and 496 deletions
|
@ -848,7 +848,6 @@ int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, floa
|
|||
|
||||
ms = BotMoveStateFromHandle(movestate);
|
||||
if (!ms) return qfalse;
|
||||
reachnum = 0;
|
||||
//if the bot has no goal or no last reachability
|
||||
if (!ms->lastreachnum || !goal) return qfalse;
|
||||
|
||||
|
@ -997,12 +996,13 @@ void MoverBottomCenter(aas_reachability_t *reach, vec3_t bottomcenter)
|
|||
//===========================================================================
|
||||
float BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
|
||||
{
|
||||
float dist, startz;
|
||||
int dist;
|
||||
float startz;
|
||||
vec3_t start, end;
|
||||
aas_trace_t trace;
|
||||
|
||||
//do gap checking
|
||||
startz = origin[2];
|
||||
//startz = origin[2];
|
||||
//this enables walking down stairs more fluidly
|
||||
{
|
||||
VectorCopy(origin, start);
|
||||
|
@ -1030,7 +1030,7 @@ float BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
|
|||
end[2] -= 20;
|
||||
if (AAS_PointContents(end) & CONTENTS_WATER) break;
|
||||
//if a gap is found slow down
|
||||
//botimport.Print(PRT_MESSAGE, "gap at %f\n", dist);
|
||||
//botimport.Print(PRT_MESSAGE, "gap at %i\n", dist);
|
||||
return dist;
|
||||
} //end if
|
||||
startz = trace.endpos[2];
|
||||
|
@ -1480,7 +1480,6 @@ bot_moveresult_t BotTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *
|
|||
//===========================================================================
|
||||
bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *reach)
|
||||
{
|
||||
float dist;
|
||||
vec3_t hordir;
|
||||
bot_moveresult_t_cleared( result );
|
||||
|
||||
|
@ -1490,7 +1489,6 @@ bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachabili
|
|||
hordir[0] = reach->end[0] - ms->origin[0];
|
||||
hordir[1] = reach->end[1] - ms->origin[1];
|
||||
hordir[2] = 0;
|
||||
dist = VectorNormalize(hordir);
|
||||
//
|
||||
BotCheckBlocked(ms, hordir, qtrue, &result);
|
||||
//
|
||||
|
@ -1567,7 +1565,6 @@ bot_moveresult_t BotTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *re
|
|||
bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *reach)
|
||||
{
|
||||
vec3_t dir, pnt;
|
||||
float dist;
|
||||
bot_moveresult_t_cleared( result );
|
||||
|
||||
//botimport.Print(PRT_MESSAGE, "BotFinishTravel_WaterJump\n");
|
||||
|
@ -1583,7 +1580,6 @@ bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability
|
|||
dir[0] += crandom() * 10;
|
||||
dir[1] += crandom() * 10;
|
||||
dir[2] += 70 + crandom() * 10;
|
||||
dist = VectorNormalize(dir);
|
||||
//elemantary actions
|
||||
EA_Move(ms->client, dir, 400);
|
||||
//set the ideal view angles
|
||||
|
@ -1721,7 +1717,6 @@ bot_moveresult_t BotFinishTravel_WalkOffLedge(bot_movestate_t *ms, aas_reachabil
|
|||
VectorCopy(dir, hordir);
|
||||
hordir[2] = 0;
|
||||
//
|
||||
dist = VectorNormalize(hordir);
|
||||
speed = 400;
|
||||
} //end if
|
||||
//
|
||||
|
@ -1788,6 +1783,7 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
|
|||
bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
|
||||
{
|
||||
vec3_t hordir, dir1, dir2, mins, maxs, start, end;
|
||||
int gapdist;
|
||||
float dist1, dist2, speed;
|
||||
bot_moveresult_t_cleared( result );
|
||||
bsp_trace_t trace;
|
||||
|
@ -1808,13 +1804,13 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
|
|||
trace = AAS_Trace(start, mins, maxs, end, ms->entitynum, MASK_PLAYERSOLID);
|
||||
if (trace.startsolid) VectorCopy(start, trace.endpos);
|
||||
//check for a gap
|
||||
for (dist1 = 0; dist1 < 80; dist1 += 10)
|
||||
for (gapdist = 0; gapdist < 80; gapdist += 10)
|
||||
{
|
||||
VectorMA(start, dist1+10, hordir, end);
|
||||
VectorMA(start, gapdist+10, hordir, end);
|
||||
end[2] += 1;
|
||||
if (AAS_PointAreaNum(end) != ms->reachareanum) break;
|
||||
} //end for
|
||||
if (dist1 < 80) VectorMA(reach->start, dist1, hordir, trace.endpos);
|
||||
if (gapdist < 80) VectorMA(reach->start, gapdist, hordir, trace.endpos);
|
||||
// dist1 = BotGapDistance(start, hordir, ms->entitynum);
|
||||
// if (dist1 && dist1 <= trace.fraction * 80) VectorMA(reach->start, dist1-20, hordir, trace.endpos);
|
||||
//
|
||||
|
@ -1860,6 +1856,7 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
|
|||
{
|
||||
vec3_t hordir, dir1, dir2, start, end, runstart;
|
||||
// vec3_t runstart, dir1, dir2, hordir;
|
||||
int gapdist;
|
||||
float dist1, dist2, speed;
|
||||
bot_moveresult_t_cleared( result );
|
||||
|
||||
|
@ -1875,13 +1872,13 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
|
|||
start[2] += 1;
|
||||
VectorMA(reach->start, 80, hordir, runstart);
|
||||
//check for a gap
|
||||
for (dist1 = 0; dist1 < 80; dist1 += 10)
|
||||
for (gapdist = 0; gapdist < 80; gapdist += 10)
|
||||
{
|
||||
VectorMA(start, dist1+10, hordir, end);
|
||||
VectorMA(start, gapdist+10, hordir, end);
|
||||
end[2] += 1;
|
||||
if (AAS_PointAreaNum(end) != ms->reachareanum) break;
|
||||
} //end for
|
||||
if (dist1 < 80) VectorMA(reach->start, dist1, hordir, runstart);
|
||||
if (gapdist < 80) VectorMA(reach->start, gapdist, hordir, runstart);
|
||||
//
|
||||
VectorSubtract(ms->origin, reach->start, dir1);
|
||||
dir1[2] = 0;
|
||||
|
@ -2867,7 +2864,6 @@ bot_moveresult_t BotFinishTravel_WeaponJump(bot_movestate_t *ms, aas_reachabilit
|
|||
//===========================================================================
|
||||
bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reach)
|
||||
{
|
||||
float dist, speed;
|
||||
vec3_t hordir;
|
||||
bot_moveresult_t_cleared( result );
|
||||
|
||||
|
@ -2875,12 +2871,10 @@ bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reac
|
|||
hordir[0] = reach->start[0] - ms->origin[0];
|
||||
hordir[1] = reach->start[1] - ms->origin[1];
|
||||
hordir[2] = 0;
|
||||
dist = VectorNormalize(hordir);
|
||||
//
|
||||
BotCheckBlocked(ms, hordir, qtrue, &result);
|
||||
speed = 400;
|
||||
//elemantary action move in direction
|
||||
EA_Move(ms->client, hordir, speed);
|
||||
EA_Move(ms->client, hordir, 400);
|
||||
VectorCopy(hordir, result.movedir);
|
||||
//
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue