//-----------------------------------------------------------------------------------
bool Path::FindPathStep()
{
    if (m_openList.empty() && m_hasBegun)
    {
        return false;
    }
    PathNode* activeNode = FindLowestFNodeOnOpenListAndRemoveIt();
    m_closedList.push_back(activeNode);
    if (activeNode->position == m_currentGoal)
    {
        RecursivelyBuildPathToStartFromNode(activeNode);
        m_hasBegun = false;
        m_openList.clear();
        m_closedList.clear();
        m_currentGoal = -Vector2Int::ONE;
        return true;
    }
    std::vector<PathNode*> validPositions;
    FindValidAdjacentPositions(validPositions, activeNode, m_currentGoal);
    for (PathNode* positionNode : validPositions)
    {
        MapPosition position = positionNode->position;
        if (IsPositionOnClosedList(positionNode->position))
            continue;
        float localG = positionNode->g; //The computed local G.
        float parentG = activeNode->g; //The parent's actual G, which includes the entire cost to get here.
        float h = positionNode->h; //The computed H for the proposed posiion
        PathNode* existingNode = FindOpenNodeWithPosInOpenList(position);
        if (existingNode)
        {
            if (localG + parentG < existingNode->g)
            {
                existingNode->UpdateVariables(activeNode, localG + parentG, h);
            }
            continue;
        }
        PathNode* newNode = new PathNode(position, activeNode, localG + parentG, h);
        m_openList.push_back(newNode);
    }
    return false;
}