summaryrefslogtreecommitdiff
path: root/src/astar.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-11 14:42:25 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-11 14:42:25 +0000
commit041c6e3cb599d019d1e92d5087ec6726a5970902 (patch)
tree893e740d13cb564fce1b5512094a123e139049dd /src/astar.cpp
parent851f567faff580834677d11b8fd45c6b344722a9 (diff)
downloadmana-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.gz
mana-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.bz2
mana-041c6e3cb599d019d1e92d5087ec6726a5970902.tar.xz
mana-041c6e3cb599d019d1e92d5087ec6726a5970902.zip
Switched NODE and PATH_NODE to use constructors.
Diffstat (limited to 'src/astar.cpp')
-rw-r--r--src/astar.cpp8
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;