Fix #10452: Don't let AyStar max_search_nodes unattended when initializing (#11544)

Add a constant with the default value of 10000 and have the pathfinding settings refer to it.

Add a preventative method to AyStar when it's initializing, to limit the number of max_search_nodes if left unattended.
This commit is contained in:
SamuXarick
2023-12-17 21:50:53 +00:00
committed by GitHub
parent 8ab3838387
commit c05ffb22bd
4 changed files with 8 additions and 2 deletions

View File

@@ -301,4 +301,7 @@ void AyStar::Init(Hash_HashProc hash, uint num_buckets)
* When that one gets full it reserves another one, till this number
* That is why it can stay this high */
this->openlist_queue.Init(102400);
/* Set a reasonable default limit */
this->max_search_nodes = AYSTAR_DEF_MAX_SEARCH_NODES;
}