Skip to content

Commit

Permalink
Moved plr variable declaration to top of function body
Browse files Browse the repository at this point in the history
  • Loading branch information
SpookyScaryDev committed Sep 16, 2024
1 parent 027dc88 commit 74a0e8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bot_botgoals.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void UpdateGoalEntity(gedict_t *item, gedict_t *taker)
// FIXME: If teammate is considerably weaker and bot needs/wants item, shout COMING instead
static qbool GoalLeaveForTeammate(gedict_t *self, gedict_t *goal_entity)
{
gedict_t* plr;

if ((g_globalvars.time < goal_entity->fb.touchPlayerTime) && goal_entity->fb.touchPlayer
&& (goal_entity->fb.touchPlayer != self))
{
Expand All @@ -69,7 +71,6 @@ static qbool GoalLeaveForTeammate(gedict_t *self, gedict_t *goal_entity)
}

// Check bot teammates so the bots don't all gang up for items
gedict_t *plr;
for (plr = world; (plr = find_plr(plr));)
{
if (plr->isBot && SameTeam(self, plr))
Expand Down

0 comments on commit 74a0e8c

Please sign in to comment.