- fixed FAFcansee not working in some edge cases where one actor is very small and poorly placed.

Instead of directly going to the alternative, let's just do a regular cansee anyway and only run the fallback if this fails. hitscan is not good enough to perform sight checks.
This commit is contained in:
Christoph Oelckers 2022-10-08 18:14:51 +02:00
parent 2cc81d0165
commit d9453138f9

View file

@ -256,10 +256,17 @@ bool FAFcansee(const DVector3& start, sectortype* sects, const DVector3& end, se
bool plax_found = false;
// ASSERT(sects >= 0 && secte >= 0);
// luckily we do not have portal setups with otherwise connected sectors, so let's go to the original routine for all cases.
// The hack job below won't always cut it.
if (cansee(start, sects, end, secte))
{
return true;
}
// early out to regular routine
if ((!sects || !FAF_Sector(sects)) && (!secte || !FAF_Sector(secte)))
{
return !!cansee(start, sects, end, secte);
return false;
}
// get angle