src/aystar.cpp
changeset 5860 7fdc9b423ba1
parent 5838 9c3129cb019b
child 6268 4b5241e5dd10
child 6443 b8f06d8eb7be
--- a/src/aystar.cpp	Thu Jan 11 15:30:35 2007 +0000
+++ b/src/aystar.cpp	Thu Jan 11 17:29:39 2007 +0000
@@ -36,8 +36,7 @@
 static void AyStarMain_ClosedList_Add(AyStar *aystar, const PathNode *node)
 {
 	// Add a node to the ClosedList
-	PathNode *new_node;
-	MallocT(&new_node, 1);
+	PathNode *new_node = MallocT<PathNode>(1);
 	*new_node = *node;
 	Hash_Set(&aystar->ClosedListHash, node->node.tile, node->node.direction, new_node);
 }
@@ -68,8 +67,7 @@
 static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, const AyStarNode *node, int f, int g)
 {
 	// Add a new Node to the OpenList
-	OpenListNode *new_node;
-	MallocT(&new_node, 1);
+	OpenListNode *new_node = MallocT<OpenListNode>(1);
 	new_node->g = g;
 	new_node->path.parent = parent;
 	new_node->path.node = *node;