Optimisation: getting portal points unsafe

This commit is contained in:
Семенов Иван 2025-03-06 16:45:04 +03:00
parent 62ebb2298e
commit f5fc9f6c2f
1 changed files with 2 additions and 10 deletions

View File

@ -2077,19 +2077,11 @@ namespace DotRecast.Detour
fromType = 0;
toType = 0;
var status = m_nav.GetTileAndPolyByRef(from, out var fromTile, out var fromPoly);
if (status.Failed())
{
return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM;
}
m_nav.GetTileAndPolyByRefUnsafe(from, out var fromTile, out var fromPoly);
fromType = fromPoly.GetPolyType();
status = m_nav.GetTileAndPolyByRef(to, out var toTile, out var toPoly);
if (status.Failed())
{
return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM;
}
m_nav.GetTileAndPolyByRefUnsafe(to, out var toTile, out var toPoly);
toType = toPoly.GetPolyType();