diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-11 14:42:25 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-11 14:42:25 +0000 |
commit | 041c6e3cb599d019d1e92d5087ec6726a5970902 (patch) | |
tree | 893e740d13cb564fce1b5512094a123e139049dd /src/astar.cpp | |
parent | 851f567faff580834677d11b8fd45c6b344722a9 (diff) | |
download | mana-client-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.gz mana-client-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.bz2 mana-client-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.xz mana-client-041c6e3cb599d019d1e92d5087ec6726a5970902.zip |
Switched NODE and PATH_NODE to use constructors.
Diffstat (limited to 'src/astar.cpp')
-rw-r--r-- | src/astar.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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(pathLocation<pathLength) { sprintf(stringa,"%i %i",path_bank[pathLocation*2-2], path_bank[pathLocation*2-1]); //alert(stringa,"","","","",0,0); - temp->next = 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; |