* Level: Implement findPath with PathFinder now.

This commit is contained in:
iProgramInCpp
2023-12-06 14:13:10 +02:00
parent cd7acc8bd7
commit 8602de2428
6 changed files with 42 additions and 26 deletions

View File

@@ -27,8 +27,8 @@ void Path::setNodes(Node** pNodes, int nodeCount)
for (int i = 0; i < nodeCount; i++)
{
// TODO: We are using the pNodes array for storage but duplicating the pNodes?
// This might cause a memory leak?
// This won't cause a memory leak since the pNodes before are managed
// by
Node* oldNode = pNodes[i];
m_pNodes[i] = new Node;
*m_pNodes[i] = *oldNode;