Add setting to increase station catchment radius.

Update acceptance and refresh screen when catchment settings change.
This commit is contained in:
Jonathan G Rennison
2016-11-20 01:49:10 +00:00
parent 10ae23d3b9
commit 37a58fd11d
18 changed files with 46 additions and 15 deletions

View File

@@ -60,7 +60,7 @@ void DrawZoningSprites(SpriteID image, SpriteID colour, const TileInfo *ti)
*/
bool IsAreaWithinAcceptanceZoneOfStation(TileArea area, Owner owner, StationFacility facility_mask)
{
int catchment = _settings_game.station.station_spread + (_settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED);
int catchment = _settings_game.station.station_spread + (_settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED) + _settings_game.station.catchment_increase;
StationFinder morestations(TileArea(TileXY(TileX(area.tile) - (catchment / 2), TileY(area.tile) - (catchment / 2)),
TileX(area.tile) + area.w + catchment, TileY(area.tile) + area.h + catchment));
@@ -90,7 +90,7 @@ bool IsAreaWithinAcceptanceZoneOfStation(TileArea area, Owner owner, StationFaci
*/
bool IsTileWithinAcceptanceZoneOfStation(TileIndex tile, Owner owner, StationFacility facility_mask, bool open_window_only)
{
int catchment = _settings_game.station.station_spread + (_settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED);
int catchment = _settings_game.station.station_spread + (_settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED) + _settings_game.station.catchment_increase;
StationFinder morestations(TileArea(TileXY(TileX(tile) - (catchment / 2), TileY(tile) - (catchment / 2)),
catchment, catchment));