Node fixed, can disable sv_lanonly

This commit is contained in:
INeedBots 2020-11-18 01:28:16 -06:00
parent 1c5090fbc1
commit 0b039fc397
2 changed files with 24 additions and 2 deletions

View File

@ -1708,6 +1708,21 @@ AStarSearch(start, goal, team, greedy_path)
goalwp = _goalwp; goalwp = _goalwp;
goalwp = goalwp.index; goalwp = goalwp.index;
/*storeKey = "astarcache " + startwp + " " + goalwp;
if (StoreHas(storeKey))
{
path = [];
pathArrStr = tokenizeLine(StoreGet(storeKey), ",");
pathArrSize = pathArrStr.size;
for (i = 0; i < pathArrSize; i++)
{
path[path.size] = int(pathArrStr[i]);
}
return path;
}*/
goalorg = level.waypoints[goalWp].origin; goalorg = level.waypoints[goalWp].origin;
node = spawnStruct(); node = spawnStruct();
@ -1734,6 +1749,7 @@ AStarSearch(start, goal, team, greedy_path)
if(bestNode.index == goalwp) if(bestNode.index == goalwp)
{ {
path = []; path = [];
//storeStr = "";
while(isDefined(bestNode)) while(isDefined(bestNode))
{ {
@ -1743,9 +1759,15 @@ AStarSearch(start, goal, team, greedy_path)
//construct path //construct path
path[path.size] = bestNode.index; path[path.size] = bestNode.index;
//storeStr += bestNode.index;
bestNode = bestNode.parent; bestNode = bestNode.parent;
/*if (isDefined(bestNode))
storeStr += ",";*/
} }
//StoreSet(storeKey, storeStr);
return path; return path;
} }

View File

@ -1 +1 @@
start "" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "1" +set net_port "28960" +set fs_game "" +exec server.cfg +map_rotate start "" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_port "28960" +set fs_game "" +exec server.cfg +map_rotate