- 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.

This commit is contained in:
Christoph Oelckers 2017-01-08 19:34:04 +01:00
parent 7a5171a2e9
commit c9964d36d6

View file

@ -791,6 +791,7 @@ sightcounts[2]++;
bool traverseres = P_SightTraverseIntercepts ( ); 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 (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; return traverseres;
} }
@ -820,6 +821,11 @@ bool P_CheckSight (AActor *t1, AActor *t2, int flags)
return false; return false;
} }
if (t2->player)
{
int a = 0;
}
const sector_t *s1 = t1->Sector; const sector_t *s1 = t1->Sector;
const sector_t *s2 = t2->Sector; const sector_t *s2 = t2->Sector;
int pnum = int(s1->Index()) * level.sectors.Size() + int(s2->Index()); int pnum = int(s1->Index()) * level.sectors.Size() + int(s2->Index());