From 041c6e3cb599d019d1e92d5087ec6726a5970902 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 11 Dec 2004 14:42:25 +0000 Subject: Switched NODE and PATH_NODE to use constructors. --- src/astar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/astar.cpp') diff --git a/src/astar.cpp b/src/astar.cpp index 5fff9687..00d3be4b 100644 --- a/src/astar.cpp +++ b/src/astar.cpp @@ -288,18 +288,20 @@ PATH_NODE *find_path(int pathfinderID, int s_x, int s_y, int e_x, int e_y) { PATH_NODE *ret = NULL, *temp = NULL; pathLocation = 1; - ret = create_path_node(s_x,s_y); + ret = new PATH_NODE(s_x, s_y); temp = ret; //alert(stringa,"","","","",0,0); while(pathLocationnext = create_path_node(path_bank[pathLocation*2-2], path_bank[pathLocation*2-1]); + temp->next = new PATH_NODE( + path_bank[pathLocation * 2 - 2], + path_bank[pathLocation * 2 - 1]); if(temp->next==NULL)ok("Error", "Unable to create path node"); temp = temp->next; pathLocation++; } - if(temp!=NULL)temp->next = create_path_node(e_x, e_y); + if(temp!=NULL)temp->next = new PATH_NODE(e_x, e_y); else ok("Error", "Null reference"); return ret; -- cgit v1.2.3-70-g09d2