Recast: use improve unionTraverseLinkedPolyGroups performance

Use the unsafe version of getTileAndPolyByRef instead, the refs have already been validated by the time we reach this function.
This commit is contained in:
Kawe Mazidjatari 2024-08-22 14:06:23 +02:00
parent 759dab221b
commit 0bcafc9928

View File

@ -437,14 +437,10 @@ static void unionTraverseLinkedPolyGroups(const dtTraverseTableCreateParams* par
if (link->traverseType == DT_NULL_TRAVERSE_TYPE)
continue;
const dtPoly* landPoly;
const dtMeshTile* landTile;
const dtPoly* landPoly;
if (dtStatusFailed(nav->getTileAndPolyByRef(link->ref, &landTile, &landPoly)))
{
rdAssert(0); // Invalid traverse link generated, code bug.
continue;
}
nav->getTileAndPolyByRefUnsafe(link->ref, &landTile, &landPoly);
rdAssert(landPoly->getType() != DT_POLYTYPE_OFFMESH_CONNECTION);
rdAssert(landPoly->groupId != DT_UNLINKED_POLY_GROUP);