HomeWildfire Games

Hierarchical pathfinder: fix an issue with regions and some touch-ups

Description

Hierarchical pathfinder: fix an issue with regions and some touch-ups

FindPassableRegions intends to return all passable regions in a chunk, but did not as it used the number of regions in that chunk. In fact, regions can have individual IDs higher than the number of regions (as shown by the test), therefore FindPassableRegions might miss some.
This only affected the JPS pathfinder, when starting on an impassable cell, which called FindNearestPassableNavcell with then possibly returned a sub-optimal navcell. This is a limited impact but upcoming patches will rely on that function more.

Fixed using a vector to store IDs, which also makes for-range loops usable.

Differential Revision: https://code.wildfiregames.com/D1832