Skip to content

Commit

Permalink
Fixed qvm errors in bot_botpath.c
Browse files Browse the repository at this point in the history
  • Loading branch information
SpookyScaryDev committed Sep 16, 2024
1 parent 184ec74 commit 964f0b9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/bot_botpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ static qbool LookingAtPlayer(gedict_t *self)

void LookAtButton(gedict_t* button, qbool buttonIsDoor)
{
gedict_t* target = buttonIsDoor ? button->fb.door_entity : button;
gedict_t *target = buttonIsDoor ? button->fb.door_entity : button;
gedict_t *trigger = PROG_TO_EDICT(target->s.v.enemy);

vec3_t target_origin;
VectorScale(target->s.v.absmin, 0.5, target_origin);
Expand All @@ -190,8 +191,6 @@ void LookAtButton(gedict_t* button, qbool buttonIsDoor)
target_origin[0], target_origin[1], target_origin[2],
true, self);

gedict_t* trigger = PROG_TO_EDICT(target->s.v.enemy);

if (g_globalvars.trace_fraction == 1 ||
PROG_TO_EDICT(g_globalvars.trace_ent) == target ||
PROG_TO_EDICT(g_globalvars.trace_ent) == button)
Expand Down Expand Up @@ -239,14 +238,15 @@ qbool CheckLookAtButton(gedict_t* self)

if (marker)
{
for (int i = 0; i < NUMBER_PATHS; i++)
int i;
for (i = 0; i < NUMBER_PATHS; i++)
{
fb_path_t* path = &marker->fb.paths[i];

if (!path->next_marker || !(path->flags & LOOK_BUTTON)) continue;

LookAtButton(path->next_marker, false);
return true;
if (path->next_marker && (path->flags & LOOK_BUTTON)) {
LookAtButton(path->next_marker, false);
return true;
}
}
}

Expand Down

0 comments on commit 964f0b9

Please sign in to comment.