Recast: properly flag off-mesh connection polygons

MSET 7 or higher needs proper off-mesh connection flags.
This commit is contained in:
Kawe Mazidjatari 2024-09-19 00:11:49 +02:00
parent 30570981e1
commit b2d0db40ef
2 changed files with 12 additions and 3 deletions

View File

@ -128,8 +128,13 @@ void OffMeshConnectionTool::handleClick(const float* /*s*/, const float* p, bool
}
else
{
const unsigned char area = EDITOR_POLYAREA_JUMP;
const unsigned short flags = EDITOR_POLYFLAGS_WALK;
const unsigned char area = DT_POLYAREA_JUMP;
const unsigned short flags = DT_POLYFLAGS_WALK
#if DT_NAVMESH_SET_VERSION >= 7
| DT_POLYFLAGS_JUMP;
#else
;
#endif;
geom->addOffMeshConnection(m_hitPos, p, m_radius, m_bidir ? 1 : 0,
(unsigned char)m_traverseType, m_invertVertexLookupOrder ? 1 : 0, area, flags);
m_hitPosSet = false;

View File

@ -672,7 +672,11 @@ dtStatus dtNavMesh::connectOffMeshLinks(const dtTileRef tileRef)
return DT_FAILURE | DT_OUT_OF_MEMORY;
}
// Off-mesh links have been established, break out entirely.
#if DT_NAVMESH_SET_VERSION >= 7
// Off-mesh link is fully linked, mark it.
conPoly->flags |= DT_POLYFLAGS_JUMP_LINKED;
#endif
// All links have been established, break out entirely.
breakOut = true;
break;
}