summaryrefslogtreecommitdiff
path: root/src/station_base.h
diff options
context:
space:
mode:
authordP <dp@dpointer.org>2020-05-12 02:21:14 +0300
committerCharles Pigott <charlespigott@googlemail.com>2020-05-13 08:43:01 +0100
commitf2a9a1e2a5282d91760783bd04df3603badd2ba9 (patch)
tree202b462b0f617bf0b24995685547cb4671d00d88 /src/station_base.h
parent7bd52970a1e83cb88069e73e26479eb71bd17726 (diff)
downloadopenttd-f2a9a1e2a5282d91760783bd04df3603badd2ba9.tar.xz
Fix #8137: New clients can't join (desync) after funding an industry
Diffstat (limited to 'src/station_base.h')
-rw-r--r--src/station_base.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/station_base.h b/src/station_base.h
index 3be7d4437..75b1c1112 100644
--- a/src/station_base.h
+++ b/src/station_base.h
@@ -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;
}
}
}