Recast: fix bug when removing and readding tiles on unlinked polygons

We would only clear polygons that weren't marked as unlinked, this was introduced when the prune tool was refactored to use the unlinked polygroup tag. The side effect is, when you remove a tile, and cause a polygon on a neighbor tile to not link to anything, it will be marked as unlinked which is the correct behavior, but when you readd the tile, the entire island will be marked as unlinked.

The function dtCreateDisjointPolyGroups got fixed later by not taking traverse links into account, since polygon islands linked together with traverse links are still disjoint. This was also the time the check had to be removed when clearing all labels but this didn't happen.

Removing and readding tiles now work properly after this patch.
This commit is contained in:
Kawe Mazidjatari 2024-08-28 14:40:08 +02:00
parent b144b200ad
commit 4dfdbaee17

View File

@ -280,9 +280,7 @@ bool dtCreateDisjointPolyGroups(const dtTraverseTableCreateParams* params)
{
dtPoly& poly = tile->polys[j];
if (poly.groupId != DT_UNLINKED_POLY_GROUP)
poly.groupId = DT_NULL_POLY_GROUP;
poly.groupId = DT_NULL_POLY_GROUP;
#if DT_NAVMESH_SET_VERSION >= 7
// NOTE: these fields are unknown and need to be reversed.
// It is possible these are used internally only.