Fix game warnings

This commit is contained in:
Tim Angus 2014-09-01 11:09:11 +01:00
parent b55809b925
commit fbdb3e0875
2 changed files with 7 additions and 3 deletions

View file

@ -1174,6 +1174,10 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
if (!botstates[client]) botstates[client] = G_Alloc(sizeof(bot_state_t)); if (!botstates[client]) botstates[client] = G_Alloc(sizeof(bot_state_t));
bs = botstates[client]; bs = botstates[client];
if (!bs) {
return qfalse;
}
if (bs && bs->inuse) { if (bs && bs->inuse) {
BotAI_Print(PRT_FATAL, "BotAISetupClient: client %d already setup\n", client); BotAI_Print(PRT_FATAL, "BotAISetupClient: client %d already setup\n", client);
return qfalse; return qfalse;

View file

@ -161,7 +161,7 @@ int BotSortTeamMatesByBaseTravelTime(bot_state_t *bs, int *teammates, int maxtea
//skip spectators //skip spectators
if (atoi(Info_ValueForKey(buf, "t")) == TEAM_SPECTATOR) continue; if (atoi(Info_ValueForKey(buf, "t")) == TEAM_SPECTATOR) continue;
// //
if (BotSameTeam(bs, i)) { if (BotSameTeam(bs, i) && goal) {
// //
traveltime = BotClientTravelTimeToGoal(i, goal); traveltime = BotClientTravelTimeToGoal(i, goal);
// //
@ -337,7 +337,7 @@ BotCTFOrders
*/ */
void BotCTFOrders_BothFlagsNotAtBase(bot_state_t *bs) { void BotCTFOrders_BothFlagsNotAtBase(bot_state_t *bs) {
int numteammates, defenders, attackers, i, other; int numteammates, defenders, attackers, i, other;
int teammates[MAX_CLIENTS]; int teammates[MAX_CLIENTS] = {0};
char name[MAX_NETNAME], carriername[MAX_NETNAME]; char name[MAX_NETNAME], carriername[MAX_NETNAME];
numteammates = BotSortTeamMatesByBaseTravelTime(bs, teammates, sizeof(teammates)); numteammates = BotSortTeamMatesByBaseTravelTime(bs, teammates, sizeof(teammates));
@ -695,7 +695,7 @@ BotCTFOrders
*/ */
void BotCTFOrders_BothFlagsAtBase(bot_state_t *bs) { void BotCTFOrders_BothFlagsAtBase(bot_state_t *bs) {
int numteammates, defenders, attackers, i; int numteammates, defenders, attackers, i;
int teammates[MAX_CLIENTS]; int teammates[MAX_CLIENTS] = {0};
char name[MAX_NETNAME]; char name[MAX_NETNAME];
//sort team mates by travel time to base //sort team mates by travel time to base