fix: prevent loading graphs with less than 8 nodes (brokes pathfinder)
fix: prevent running A* with less than 8 nodes (in case converted one) fix: trying to play with graph author/modified stuff per #374
This commit is contained in:
parent
18ee4ce38b
commit
a3288cc353
3 changed files with 20 additions and 15 deletions
|
|
@ -1404,6 +1404,12 @@ void Bot::findPath (int srcIndex, int destIndex, FindPath pathType /*= FindPath:
|
|||
return;
|
||||
}
|
||||
|
||||
// astar needs some nodes to work with
|
||||
if (graph.length () < kMaxNodeLinks) {
|
||||
logger.error ("A* Search for bot \"%s\" has failed due to too small number of nodes (%d). Seems to be graph is broken.", pev->netname.chars (), graph.length ());
|
||||
return;
|
||||
}
|
||||
|
||||
// holders for heuristic functions
|
||||
static Lambda <float (int, int, int)> gcalc, hcalc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue