Fixed problem in CheckForShadows().

Fixed a regression in CheckForShadows() that made it always return a +SHADOW or +SHADOWBLOCK actor even when there were none. Causing monsters to always have messy aim if +DOSHADOWBLOCK is on.
This commit is contained in:
inkoalawetrust 2024-10-01 17:17:48 +03:00 committed by Ricardo Luís Vaz Silva
parent 568a39d203
commit 2c9b8f4eec

View file

@ -88,6 +88,7 @@ inline AActor* CheckForShadows(AActor* self, AActor* other, DVector3 pos, double
if ((other && (other->flags & MF_SHADOW)) || (self->flags9 & MF9_DOSHADOWBLOCK))
{
AActor* shadowBlock = P_CheckForShadowBlock(self, other, pos, penaltyFactor);
if (other && !(other->flags & MF_SHADOW)) other = nullptr; //Other doesn't have MF_SHADOW, so don't count them as a valid return.
return shadowBlock ? shadowBlock : other;
}
return nullptr;