node = findchainentity(owner,openlist);
if(!node)
- return world;
+ return NULL;
bestnode = node;
while(node)
}
if(node == best_open_node)
- best_open_node = world;
+ best_open_node = NULL;
++pathlib_closed_cnt;
--pathlib_open_cnt;
void pathlib_cleanup()
{
- best_open_node = world;
+ best_open_node = NULL;
//return;
entity node;
- node = findfloat(world,is_path_node, true);
+ node = findfloat(NULL,is_path_node, true);
while(node)
{
/*
node.pathlib_node_g = 0;
node.pathlib_node_h = 0;
node.pathlib_node_f = 0;
- node.path_prev = world;
+ node.path_prev = NULL;
*/
dumpnode(node);
if(closedlist)
remove(closedlist);
- openlist = world;
- closedlist = world;
+ openlist = NULL;
+ closedlist = NULL;
}
//to_z += 32;
LOG_TRACE("AStar init\n");
- path = pathlib_mknode(from, world);
+ path = pathlib_mknode(from, NULL);
pathlib_close_node(path, to);
if(pathlib_foundgoal)
{
LOG_TRACE("AStar path fail.\n");
pathlib_cleanup();
- return world;
+ return NULL;
}
best_open_node = pathlib_getbestopen();
LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
pathlib_cleanup();
- return world;
+ return NULL;
}
best_open_node = pathlib_getbestopen();
ftime = gettime(GETTIME_REALTIME);
ptime = ftime - ptime;
- start = path_build(world,path.origin,world,world);
- end = path_build(world,goal_node.origin,world,start);
+ start = path_build(NULL,path.origin,NULL,NULL);
+ end = path_build(NULL,goal_node.origin,NULL,start);
ln = end;
open = goal_node;
pathlib_cleanup();
- return world;
+ return NULL;
}