Fix some Collision NaN/inf's

This commit is contained in:
erorcun
2021-01-28 00:51:43 +03:00
parent e9054f2980
commit 2b269ff1c0
2 changed files with 23 additions and 6 deletions

View File

@ -431,10 +431,10 @@ CWorld::ProcessVerticalLineSector(CSector &sector, const CColLine &line, CColPoi
}
bool
CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist,
CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &mindist,
CEntity *&entity, bool ignoreSeeThrough, CStoredCollPoly *poly)
{
float mindist = dist;
float dist = mindist;
CPtrNode *node;
CEntity *e;
CColModel *colmodel;
@ -451,8 +451,8 @@ CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CCol
}
}
if(mindist < dist) {
dist = mindist;
if(dist < mindist) {
mindist = dist;
return true;
} else
return false;