Skip to content

Commit

Permalink
Fix game warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Sep 1, 2014
1 parent b55809b commit fbdb3e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions code/game/ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
bs = botstates[client];

if (!bs) {
return qfalse;
}

if (bs && bs->inuse) {
BotAI_Print(PRT_FATAL, "BotAISetupClient: client %d already setup\n", client);
return qfalse;
Expand Down
6 changes: 3 additions & 3 deletions code/game/ai_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int BotSortTeamMatesByBaseTravelTime(bot_state_t *bs, int *teammates, int maxtea
//skip spectators
if (atoi(Info_ValueForKey(buf, "t")) == TEAM_SPECTATOR) continue;
//
if (BotSameTeam(bs, i)) {
if (BotSameTeam(bs, i) && goal) {
//
traveltime = BotClientTravelTimeToGoal(i, goal);
//
Expand Down Expand Up @@ -337,7 +337,7 @@ BotCTFOrders
*/
void BotCTFOrders_BothFlagsNotAtBase(bot_state_t *bs) {
int numteammates, defenders, attackers, i, other;
int teammates[MAX_CLIENTS];
int teammates[MAX_CLIENTS] = {0};
char name[MAX_NETNAME], carriername[MAX_NETNAME];

numteammates = BotSortTeamMatesByBaseTravelTime(bs, teammates, sizeof(teammates));
Expand Down Expand Up @@ -695,7 +695,7 @@ BotCTFOrders
*/
void BotCTFOrders_BothFlagsAtBase(bot_state_t *bs) {
int numteammates, defenders, attackers, i;
int teammates[MAX_CLIENTS];
int teammates[MAX_CLIENTS] = {0};
char name[MAX_NETNAME];

//sort team mates by travel time to base
Expand Down

0 comments on commit fbdb3e0

Please sign in to comment.