File diff r16167:525774f67f3f → r16168:2f238bf05ef6
src/pathfinder/npf/aystar.cpp
Show inline comments
 
@@ -35,18 +35,18 @@ static PathNode *AyStarMain_ClosedList_I
 
{
 
	return (PathNode*)Hash_Get(&aystar->ClosedListHash, node->tile, node->direction);
 
}
 

	
 
/* This adds a node to the ClosedList
 
 *  It makes a copy of the data */
 
static void AyStarMain_ClosedList_Add(AyStar *aystar, const PathNode *node)
 
void AyStar::ClosedListAdd(const PathNode *node)
 
{
 
	/* Add a node to the ClosedList */
 
	PathNode *new_node = MallocT<PathNode>(1);
 
	*new_node = *node;
 
	Hash_Set(&aystar->ClosedListHash, node->node.tile, node->node.direction, new_node);
 
	Hash_Set(&this->ClosedListHash, node->node.tile, node->node.direction, new_node);
 
}
 

	
 
/* Checks if a node is in the OpenList
 
 *   If so, it returns the OpenListNode, else NULL */
 
OpenListNode *AyStar::OpenListIsInList(const AyStarNode *node)
 
{
 
@@ -165,13 +165,13 @@ int AyStar::Loop()
 
		}
 
		free(current);
 
		return AYSTAR_FOUND_END_NODE;
 
	}
 

	
 
	/* Add the node to the ClosedList */
 
	AyStarMain_ClosedList_Add(this, &current->path);
 
	this->ClosedListAdd(&current->path);
 

	
 
	/* Load the neighbours */
 
	this->GetNeighbours(this, current);
 

	
 
	/* Go through all neighbours */
 
	for (i = 0; i < this->num_neighbours; i++) {