mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
Fix invisibility affect on enemies
When performing the ShadowBlock check, we previously would return a nullptr actor if nothing was between the monster and the player. This resulted in the monster aiming as if you didn't have invisibility. Fall back to returning the target actor if it is shadowed but nothing is in between the two.
This commit is contained in:
parent
cf8a04c457
commit
3bc54d3757
1 changed files with 6 additions and 1 deletions
|
@ -85,7 +85,12 @@ inline bool AffectedByShadows(AActor* self)
|
|||
|
||||
inline AActor* CheckForShadows(AActor* self, AActor* other, DVector3 pos, double& penaltyFactor)
|
||||
{
|
||||
return ((other && (other->flags & MF_SHADOW)) || (self->flags9 & MF9_DOSHADOWBLOCK)) ? P_CheckForShadowBlock(self, other, pos, penaltyFactor) : nullptr;
|
||||
if ((other && (other->flags & MF_SHADOW)) || (self->flags9 & MF9_DOSHADOWBLOCK))
|
||||
{
|
||||
AActor* shadowBlock = P_CheckForShadowBlock(self, other, pos, penaltyFactor);
|
||||
return shadowBlock ? shadowBlock : other;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline AActor* PerformShadowChecks(AActor* self, AActor* other, DVector3 pos, double& penaltyFactor)
|
||||
|
|
Loading…
Reference in a new issue