fixed COcclusion

This commit is contained in:
aap 2020-07-20 23:25:04 +02:00
parent ee2d0ffc14
commit 5bedca7692
5 changed files with 74 additions and 56 deletions

View file

@ -1160,12 +1160,11 @@ bool IsEntityPointerValid(CEntity* pEntity)
}
bool CEntity::IsEntityOccluded(void) {
return false;
CVector coors;
float width, height;
if (!COcclusion::NumActiveOccluders || !CalcScreenCoors(GetBoundCentre(), &coors, &width, &height))
if (COcclusion::NumActiveOccluders == 0 || !CalcScreenCoors(GetBoundCentre(), &coors, &width, &height))
return false;
float area = Max(width, height) * GetBoundRadius() * 0.9f;