From c9964d36d695f435f24f08e0b8feb4a1d3dddd6a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 19:34:04 +0100 Subject: [PATCH] - fixed: A single sight check iteration may not succeed if origin and end point are in different portal groups. All those may do is collect more portals. --- src/p_sight.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_sight.cpp b/src/p_sight.cpp index a482f602d..40a392f32 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -791,6 +791,7 @@ sightcounts[2]++; bool traverseres = P_SightTraverseIntercepts ( ); if (itres == -1) return false; // if the iterator had an early out there was no line of sight. The traverser was only called to collect more portals. + if (seeingthing->Sector->PortalGroup != portalgroup) return false; // We are in a different group than the seeingthing, so this trace cannot determine visibility alone. return traverseres; } @@ -820,6 +821,11 @@ bool P_CheckSight (AActor *t1, AActor *t2, int flags) return false; } + if (t2->player) + { + int a = 0; + } + const sector_t *s1 = t1->Sector; const sector_t *s2 = t2->Sector; int pnum = int(s1->Index()) * level.sectors.Size() + int(s2->Index());