From a82a99f68dfb740d752e422559859b054ffe1cfa Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 21 Apr 2018 14:39:18 -0500 Subject: [PATCH] Fix uninitialized bot_goal_t fields --- code/botlib/be_ai_goal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/botlib/be_ai_goal.c b/code/botlib/be_ai_goal.c index 4df36887..de7d6ecc 100644 --- a/code/botlib/be_ai_goal.c +++ b/code/botlib/be_ai_goal.c @@ -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 @@ -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 @@ -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