From 86bdbce7b1e32577270514e2d7e72d9d15e849d2 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 7 Jul 2024 16:58:04 +0200 Subject: [PATCH] Server: add indices for first traverse anim types per navmesh type --- src/public/game/server/ai_navmesh.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/public/game/server/ai_navmesh.h b/src/public/game/server/ai_navmesh.h index b3753200..46bd2e0f 100644 --- a/src/public/game/server/ai_navmesh.h +++ b/src/public/game/server/ai_navmesh.h @@ -45,7 +45,7 @@ inline const int g_navMeshTraverseTableCountIndicesPerType[NAVMESH_COUNT] = { inline int NavMesh_GetTraversalTableCountForNavMeshType(const NavMeshType_e navMeshType) { - Assert(navMeshType >= 0 && navMeshType < V_ARRAYSIZE(g_navMeshTraverseTableCountIndicesPerType)); + Assert(navMeshType >= 0 && navMeshType < NAVMESH_COUNT); return g_navMeshTraverseTableCountIndicesPerType[navMeshType]; } @@ -61,8 +61,24 @@ inline const int g_navMeshTraverseTableIndicesPerType[ANIMTYPE_COUNT] = { inline int NavMesh_GetTraversalTableIndexForAnimType(const TraverseAnimType_e animType) { - Assert(animType >= 0 && animType < V_ARRAYSIZE(g_navMeshTraverseTableIndicesPerType)); + Assert(animType >= 0 && animType < ANIMTYPE_COUNT); return animType + g_navMeshTraverseTableIndicesPerType[animType]; } + +inline const TraverseAnimType_e g_navMeshFirstTraverseAnimTypeForNavMeshType[NAVMESH_COUNT] +{ + ANIMTYPE_HUMAN, // NAVMESH_SMALL starts at traversal table 0, + ANIMTYPE_PROWLER, + ANIMTYPE_SUPER_SPECTRE, + ANIMTYPE_TITAN, + ANIMTYPE_GOLIATH +}; + +inline TraverseAnimType_e NavMesh_GetFirstTraverseAnimTypeForType(const NavMeshType_e navMeshType) +{ + Assert(navMeshType >= 0 && navMeshType < NAVMESH_COUNT); + return g_navMeshFirstTraverseAnimTypeForNavMeshType[navMeshType]; +} + #endif // AI_NAVMESH_H