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
|
@ -959,9 +959,9 @@ BotChatTime
|
|||
==================
|
||||
*/
|
||||
float BotChatTime(bot_state_t *bs) {
|
||||
int cpm;
|
||||
//int cpm;
|
||||
|
||||
cpm = trap_Characteristic_BInteger(bs->character, CHARACTERISTIC_CHAT_CPM, 1, 4000);
|
||||
//cpm = trap_Characteristic_BInteger(bs->character, CHARACTERISTIC_CHAT_CPM, 1, 4000);
|
||||
|
||||
return 2.0; //(float) trap_BotChatLength(bs->cs) * 30 / cpm;
|
||||
}
|
||||
|
|
|
@ -684,9 +684,7 @@ int BotGetLongTermGoal(bot_state_t *bs, int tfl, int retreat, bot_goal_t *goal)
|
|||
bs->ltgtype = 0;
|
||||
}
|
||||
//
|
||||
if (bs->camp_range > 0) {
|
||||
//FIXME: move around a bit
|
||||
}
|
||||
//FIXME: move around a bit
|
||||
//
|
||||
trap_BotResetAvoidReach(bs->ms);
|
||||
return qfalse;
|
||||
|
|
|
@ -4429,7 +4429,8 @@ open, which buttons to activate etc.
|
|||
*/
|
||||
void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
|
||||
int movetype, bspent;
|
||||
vec3_t hordir, start, end, mins, maxs, sideward, angles, up = {0, 0, 1};
|
||||
vec3_t hordir, sideward, angles, up = {0, 0, 1};
|
||||
//vec3_t start, end, mins, maxs;
|
||||
aas_entityinfo_t entinfo;
|
||||
bot_activategoal_t activategoal;
|
||||
|
||||
|
@ -4491,11 +4492,11 @@ void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
|
|||
movetype = MOVE_WALK;
|
||||
// if there's an obstacle at the bot's feet and head then
|
||||
// the bot might be able to crouch through
|
||||
VectorCopy(bs->origin, start);
|
||||
start[2] += 18;
|
||||
VectorMA(start, 5, hordir, end);
|
||||
VectorSet(mins, -16, -16, -24);
|
||||
VectorSet(maxs, 16, 16, 4);
|
||||
//VectorCopy(bs->origin, start);
|
||||
//start[2] += 18;
|
||||
//VectorMA(start, 5, hordir, end);
|
||||
//VectorSet(mins, -16, -16, -24);
|
||||
//VectorSet(maxs, 16, 16, 4);
|
||||
//
|
||||
//bsptrace = AAS_Trace(start, mins, maxs, end, bs->entitynum, MASK_PLAYERSOLID);
|
||||
//if (bsptrace.fraction >= 1) movetype = MOVE_CROUCH;
|
||||
|
|
|
@ -192,7 +192,6 @@ typedef struct bot_state_s
|
|||
float lastair_time; //last time the bot had air
|
||||
float teleport_time; //last time the bot teleported
|
||||
float camp_time; //last time camped
|
||||
float camp_range; //camp range
|
||||
float weaponchange_time; //time the bot started changing weapons
|
||||
float firethrottlewait_time; //amount of time to wait
|
||||
float firethrottleshoot_time; //amount of time to shoot
|
||||
|
@ -264,11 +263,6 @@ typedef struct bot_state_s
|
|||
int ctfstrategy; //ctf strategy
|
||||
char subteam[32]; //sub team name
|
||||
float formation_dist; //formation team mate intervening space
|
||||
char formation_teammate[16]; //netname of the team mate the bot uses for relative positioning
|
||||
float formation_angle; //angle relative to the formation team mate
|
||||
vec3_t formation_dir; //the direction the formation is moving in
|
||||
vec3_t formation_origin; //origin the bot uses for relative positioning
|
||||
bot_goal_t formation_goal; //formation goal
|
||||
|
||||
bot_activategoal_t *activatestack; //first activate goal on the stack
|
||||
bot_activategoal_t activategoalheap[MAX_ACTIVATESTACK]; //activate goal heap
|
||||
|
|
|
@ -513,7 +513,8 @@ voiceCommand_t voiceCommands[] = {
|
|||
};
|
||||
|
||||
int BotVoiceChatCommand(bot_state_t *bs, int mode, char *voiceChat) {
|
||||
int i, voiceOnly, clientNum, color;
|
||||
int i, clientNum;
|
||||
//int voiceOnly, color;
|
||||
char *ptr, buf[MAX_MESSAGE_SIZE], *cmd;
|
||||
|
||||
if (!TeamPlayIsOn()) {
|
||||
|
@ -528,13 +529,13 @@ int BotVoiceChatCommand(bot_state_t *bs, int mode, char *voiceChat) {
|
|||
cmd = buf;
|
||||
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
|
||||
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
|
||||
voiceOnly = atoi(ptr);
|
||||
//voiceOnly = atoi(ptr);
|
||||
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
|
||||
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
|
||||
clientNum = atoi(ptr);
|
||||
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
|
||||
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
|
||||
color = atoi(ptr);
|
||||
//color = atoi(ptr);
|
||||
|
||||
if (!BotSameTeam(bs, clientNum)) {
|
||||
return qfalse;
|
||||
|
|
|
@ -232,7 +232,7 @@ PM_StepSlideMove
|
|||
*/
|
||||
void PM_StepSlideMove( qboolean gravity ) {
|
||||
vec3_t start_o, start_v;
|
||||
vec3_t down_o, down_v;
|
||||
// vec3_t down_o, down_v;
|
||||
trace_t trace;
|
||||
// float down_dist, up_dist;
|
||||
// vec3_t delta, delta2;
|
||||
|
@ -256,8 +256,8 @@ void PM_StepSlideMove( qboolean gravity ) {
|
|||
return;
|
||||
}
|
||||
|
||||
VectorCopy (pm->ps->origin, down_o);
|
||||
VectorCopy (pm->ps->velocity, down_v);
|
||||
//VectorCopy (pm->ps->origin, down_o);
|
||||
//VectorCopy (pm->ps->velocity, down_v);
|
||||
|
||||
VectorCopy (start_o, up);
|
||||
up[2] += STEPSIZE;
|
||||
|
|
|
@ -539,7 +539,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
int event;
|
||||
gclient_t *client;
|
||||
int damage;
|
||||
vec3_t dir;
|
||||
vec3_t origin, angles;
|
||||
// qboolean fired;
|
||||
gitem_t *item;
|
||||
|
@ -567,7 +566,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
} else {
|
||||
damage = 5;
|
||||
}
|
||||
VectorSet (dir, 0, 0, 1);
|
||||
ent->pain_debounce_time = level.time + 200; // no normal pain sound
|
||||
G_Damage (ent, NULL, NULL, NULL, NULL, damage, 0, MOD_FALLING);
|
||||
break;
|
||||
|
@ -1106,15 +1104,12 @@ while a slow client may have multiple ClientEndFrame between ClientThink.
|
|||
*/
|
||||
void ClientEndFrame( gentity_t *ent ) {
|
||||
int i;
|
||||
clientPersistant_t *pers;
|
||||
|
||||
if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) {
|
||||
SpectatorClientEndFrame( ent );
|
||||
return;
|
||||
}
|
||||
|
||||
pers = &ent->client->pers;
|
||||
|
||||
// turn off any expired powerups
|
||||
for ( i = 0 ; i < MAX_POWERUPS ; i++ ) {
|
||||
if ( ent->client->ps.powerups[ i ] < level.time ) {
|
||||
|
|
|
@ -216,7 +216,6 @@ LookAtKiller
|
|||
*/
|
||||
void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) {
|
||||
vec3_t dir;
|
||||
vec3_t angles;
|
||||
|
||||
if ( attacker && attacker != self ) {
|
||||
VectorSubtract (attacker->s.pos.trBase, self->s.pos.trBase, dir);
|
||||
|
@ -228,10 +227,6 @@ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker )
|
|||
}
|
||||
|
||||
self->client->ps.stats[STAT_DEAD_YAW] = vectoyaw ( dir );
|
||||
|
||||
angles[YAW] = vectoyaw ( dir );
|
||||
angles[PITCH] = 0;
|
||||
angles[ROLL] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -822,7 +817,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
vec3_t dir, vec3_t point, int damage, int dflags, int mod ) {
|
||||
gclient_t *client;
|
||||
int take;
|
||||
int save;
|
||||
int asave;
|
||||
int knockback;
|
||||
int max;
|
||||
|
@ -996,7 +990,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
damage = 1;
|
||||
}
|
||||
take = damage;
|
||||
save = 0;
|
||||
|
||||
// save some from armor
|
||||
asave = CheckArmor (targ, take, dflags);
|
||||
|
|
|
@ -281,7 +281,7 @@ int Pickup_Health (gentity_t *ent, gentity_t *other) {
|
|||
|
||||
// small and mega healths will go over the max
|
||||
#ifdef MISSIONPACK
|
||||
if( other->client && bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
if( bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
max = other->client->ps.stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1758,8 +1758,6 @@ Advances the non-player objects in the world
|
|||
void G_RunFrame( int levelTime ) {
|
||||
int i;
|
||||
gentity_t *ent;
|
||||
int msec;
|
||||
int start, end;
|
||||
|
||||
// if we are waiting for the level to restart, do nothing
|
||||
if ( level.restarted ) {
|
||||
|
@ -1769,7 +1767,6 @@ int start, end;
|
|||
level.framenum++;
|
||||
level.previousTime = level.time;
|
||||
level.time = levelTime;
|
||||
msec = level.time - level.previousTime;
|
||||
|
||||
// get any cvar changes
|
||||
G_UpdateCvars();
|
||||
|
@ -1777,7 +1774,6 @@ int start, end;
|
|||
//
|
||||
// go through all allocated objects
|
||||
//
|
||||
start = trap_Milliseconds();
|
||||
ent = &g_entities[0];
|
||||
for (i=0 ; i<level.num_entities ; i++, ent++) {
|
||||
if ( !ent->inuse ) {
|
||||
|
@ -1837,9 +1833,7 @@ int start, end;
|
|||
|
||||
G_RunThink( ent );
|
||||
}
|
||||
end = trap_Milliseconds();
|
||||
|
||||
start = trap_Milliseconds();
|
||||
// perform final fixups on the players
|
||||
ent = &g_entities[0];
|
||||
for (i=0 ; i < level.maxclients ; i++, ent++ ) {
|
||||
|
@ -1847,7 +1841,6 @@ start = trap_Milliseconds();
|
|||
ClientEndFrame( ent );
|
||||
}
|
||||
}
|
||||
end = trap_Milliseconds();
|
||||
|
||||
// see if it is time to do a tournement restart
|
||||
CheckTournament();
|
||||
|
|
|
@ -81,16 +81,6 @@ const char *TeamName(int team) {
|
|||
return "FREE";
|
||||
}
|
||||
|
||||
const char *OtherTeamName(int team) {
|
||||
if (team==TEAM_RED)
|
||||
return "BLUE";
|
||||
else if (team==TEAM_BLUE)
|
||||
return "RED";
|
||||
else if (team==TEAM_SPECTATOR)
|
||||
return "SPECTATOR";
|
||||
return "FREE";
|
||||
}
|
||||
|
||||
const char *TeamColorString(int team) {
|
||||
if (team==TEAM_RED)
|
||||
return S_COLOR_RED;
|
||||
|
@ -365,7 +355,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
targ->client->pers.teamState.lasthurtcarrier = 0;
|
||||
|
||||
attacker->client->ps.persistant[PERS_DEFEND_COUNT]++;
|
||||
team = attacker->client->sess.sessionTeam;
|
||||
// add the sprite over the player's head
|
||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||
attacker->client->ps.eFlags |= EF_AWARD_DEFEND;
|
||||
|
@ -383,7 +372,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
targ->client->pers.teamState.lasthurtcarrier = 0;
|
||||
|
||||
attacker->client->ps.persistant[PERS_DEFEND_COUNT]++;
|
||||
team = attacker->client->sess.sessionTeam;
|
||||
// add the sprite over the player's head
|
||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||
attacker->client->ps.eFlags |= EF_AWARD_DEFEND;
|
||||
|
|
|
@ -69,7 +69,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
int OtherTeam(int team);
|
||||
const char *TeamName(int team);
|
||||
const char *OtherTeamName(int team);
|
||||
const char *TeamColorString(int team);
|
||||
void AddTeamScore(vec3_t origin, int team, int score);
|
||||
|
||||
|
|
|
@ -324,7 +324,6 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
|
|||
float r, u;
|
||||
vec3_t end;
|
||||
vec3_t forward, right, up;
|
||||
int oldScore;
|
||||
qboolean hitClient = qfalse;
|
||||
|
||||
// derive the right and up vectors from the forward vector, because
|
||||
|
@ -333,8 +332,6 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
|
|||
PerpendicularVector( right, forward );
|
||||
CrossProduct( forward, right, up );
|
||||
|
||||
oldScore = ent->client->ps.persistant[PERS_SCORE];
|
||||
|
||||
// generate the "random" spread pattern
|
||||
for ( i = 0 ; i < DEFAULT_SHOTGUN_COUNT ; i++ ) {
|
||||
r = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue