Skip to content

Commit

Permalink
Fix uninitialized bot_goal_t fields
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Apr 26, 2018
1 parent e9e11f1 commit a82a99f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/botlib/be_ai_goal.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ int BotGetLevelItemGoal(int index, char *name, bot_goal_t *goal)
goal->number = li->number;
goal->flags = GFL_ITEM;
if (li->timeout) goal->flags |= GFL_DROPPED;
goal->iteminfo = li->iteminfo;
//botimport.Print(PRT_MESSAGE, "found li %s\n", itemconfig->iteminfo[li->iteminfo].name);
return li->number;
} //end if
Expand All @@ -923,6 +924,9 @@ int BotGetMapLocationGoal(char *name, bot_goal_t *goal)
goal->entitynum = 0;
VectorCopy(mins, goal->mins);
VectorCopy(maxs, goal->maxs);
goal->number = 0;
goal->flags = 0;
goal->iteminfo = 0;
return qtrue;
} //end if
} //end for
Expand Down Expand Up @@ -951,6 +955,9 @@ int BotGetNextCampSpotGoal(int num, bot_goal_t *goal)
goal->entitynum = 0;
VectorCopy(mins, goal->mins);
VectorCopy(maxs, goal->maxs);
goal->number = 0;
goal->flags = 0;
goal->iteminfo = 0;
return num+1;
} //end if
} //end for
Expand Down

0 comments on commit a82a99f

Please sign in to comment.