Fix #8137: New clients can't join (desync) after funding an industry

This commit is contained in:
dP
2020-05-12 02:21:14 +03:00
committed by Charles Pigott
parent 7bd52970a1
commit f2a9a1e2a5
4 changed files with 12 additions and 6 deletions

View File

@@ -560,7 +560,10 @@ void RebuildStationKdtree();
/**
* Call a function on all stations that have any part of the requested area within their catchment.
* @param area The tile area to check
* @tparam Func The type of funcion to call
* @param area The TileArea to check
* @param func The function to call, must take two parameters: Station* and TileIndex and return true
* if coverage of that tile is acceptable for a given station or false if search should continue
*/
template<typename Func>
void ForAllStationsAroundTiles(const TileArea &ta, Func func)
@@ -586,8 +589,7 @@ void ForAllStationsAroundTiles(const TileArea &ta, Func func)
/* Test if the tile is within the station's catchment */
TILE_AREA_LOOP(tile, ta) {
if (st->TileIsInCatchment(tile)) {
func(st);
break;
if (func(st, tile)) break;
}
}
}