Use MAX_PATHNODES rather than a constant number

This commit is contained in:
smallmodel 2025-01-21 20:56:26 +01:00
parent 19e12701f3
commit f8f9d2f65c
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 5 additions and 5 deletions

View file

@ -1001,7 +1001,7 @@ PathNode *PathSearch::FindCornerNodeForWall(
PathNode *PathSearch::FindCornerNodeForExactPath(Entity *pSelf, Sentient *enemy, float fMaxPath)
{
PathNode *pPathNode[4096];
PathNode *pPathNode[MAX_PATHNODES];
PathNode *pParentNode;
size_t i, iDepth;
Vector vEnd;
@ -1554,7 +1554,7 @@ void DrawNode(int iNodeCount)
Vector aStart;
Vector aEnd;
PathNode *node;
PathNode *nodelist[4096];
PathNode *nodelist[MAX_PATHNODES];
Vector end;
Vector start;
Vector p;
@ -1562,8 +1562,8 @@ void DrawNode(int iNodeCount)
playerorigin = g_entities[0].client->ps.origin;
if (iNodeCount > 4096) {
iNodeCount = 4096;
if (iNodeCount > MAX_PATHNODES) {
iNodeCount = MAX_PATHNODES;
}
if (ai_showallnode->integer) {

View file

@ -252,7 +252,7 @@ private:
static int m_LoadIndex;
public:
static PathNode *pathnodes[4096];
static PathNode *pathnodes[MAX_PATHNODES];
static int nodecount;
static float total_dist;
static const char *last_error;