From 2c9b8f4eec82e32b0b7771048b3027e213fe5c5e Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:17:48 +0300 Subject: [PATCH] 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. --- src/playsim/shadowinlines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/playsim/shadowinlines.h b/src/playsim/shadowinlines.h index 574abd2519..b36b051ac4 100644 --- a/src/playsim/shadowinlines.h +++ b/src/playsim/shadowinlines.h @@ -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;