Fixed: A_LookEx did not account for the +LOOKALLAROUND flag.

This commit is contained in:
Ru5tK1ng 2024-03-03 21:33:35 -06:00 committed by Christoph Oelckers
parent caa4728bd4
commit e62651e3cf

View file

@ -1271,7 +1271,7 @@ int P_IsVisible(AActor *lookee, AActor *other, INTBOOL allaround, FLookExParams
{
maxdist = params->maxDist;
mindist = params->minDist;
fov = params->Fov;
fov = allaround ? 0 : params->Fov; // [RK] Account for LOOKALLAROUND flag.
}
else
{
@ -2086,7 +2086,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LookEx)
{
// If we find a valid target here, the wandering logic should *not*
// be activated! If would cause the seestate to be set twice.
if (P_LookForPlayers(self, true, &params))
if (P_LookForPlayers(self, (self->flags4 & MF4_LOOKALLAROUND), &params)) // [RK] Passing true for allround should only occur if the flag is actually set.
goto seeyou;
}