Skip to content

Commit

Permalink
- use correct isHostile checks for target considerations
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Jan 18, 2024
1 parent cfb4e4f commit f9a88f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/playsim/p_enemy.cpp
Expand Up @@ -1823,7 +1823,7 @@ int P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
if (!(player->mo->flags & MF_SHOOTABLE))
continue; // not shootable (observer or dead)

if (actor->IsFriend(player->mo))
if (!actor->IsHostile(player->mo))
continue; // same +MF_FRIENDLY, ignore

if (player->cheats & CF_NOTARGET)
Expand Down Expand Up @@ -1917,7 +1917,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
targ = NULL;
}

if (targ && targ->player && ((targ->player->cheats & CF_NOTARGET) || !(targ->flags & MF_FRIENDLY)))
if (targ && targ->player && ((targ->player->cheats & CF_NOTARGET) || !self->IsHostile(targ)))
{
return 0;
}
Expand All @@ -1931,7 +1931,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)

if (targ && (targ->flags & MF_SHOOTABLE))
{
if (self->IsFriend (targ)) // be a little more precise!
if (!self->IsHostile (targ)) // be a little more precise!
{
// If we find a valid target here, the wandering logic should *not*
// be activated! It would cause the seestate to be set twice.
Expand Down

0 comments on commit f9a88f1

Please sign in to comment.