Recast: fix compiler warning and floor value

Value of dtCalcLinkDistance has to be floored to match Titanfall 2 values.
This commit is contained in:
Kawe Mazidjatari 2024-07-19 00:01:11 +02:00
parent e57e85b88a
commit 7d5c07b2e7

View File

@ -1739,7 +1739,7 @@ dtStatus dtNavMesh::getPolyArea(dtPolyRef ref, unsigned char* resultArea) const
unsigned char dtCalcLinkDistance(const float* spos, const float* epos)
{
return (unsigned char)rdVdist(spos, epos) / DT_TRAVERSE_DIST_QUANT_FACTOR;
return (unsigned char)rdMathFloorf(rdVdist(spos, epos) / DT_TRAVERSE_DIST_QUANT_FACTOR);
}
float dtCalcPolySurfaceArea(const dtPoly* poly, const float* verts)