summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-31 12:45:21 +0000
committerrubidium <rubidium@openttd.org>2007-08-31 12:45:21 +0000
commitc19b8c72b7514751fd3470908fbd047e1a63862b (patch)
treed7121b38c59fb1d32c00303d68f83e3235bcc381 /src/station_cmd.cpp
parentaba867d78dd52154bb7874a6998a3002dab57684 (diff)
downloadopenttd-c19b8c72b7514751fd3470908fbd047e1a63862b.tar.xz
(svn r11013) -Fix [FS#1171]: MoveGoodsToStation's search area is too small as it assumed a lower maximum catchment area than the real maximum catchment area. Based on a patch by PhilSophus.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 6f4e3cbc8..06a41a24c 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2597,9 +2597,9 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount)
if (_patches.modified_catchment) {
w_prod = w;
h_prod = h;
- w += 16;
- h += 16;
- max_rad = 8;
+ w += 2 * MAX_CATCHMENT;
+ h += 2 * MAX_CATCHMENT;
+ max_rad = MAX_CATCHMENT;
} else {
w_prod = 0;
h_prod = 0;
@@ -2624,10 +2624,10 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount)
((st->facilities & ~FACIL_TRUCK_STOP) != 0 || !IsCargoInClass(type, CC_PASSENGERS))) { // if we have other fac. than a cargo bay or the cargo is not passengers
if (_patches.modified_catchment) {
// min and max coordinates of the producer relative
- const int x_min_prod = 9;
- const int x_max_prod = 8 + w_prod;
- const int y_min_prod = 9;
- const int y_max_prod = 8 + h_prod;
+ const int x_min_prod = max_rad + 1;
+ const int x_max_prod = max_rad + w_prod;
+ const int y_min_prod = max_rad + 1;
+ const int y_max_prod = max_rad + h_prod;
int rad = FindCatchmentRadius(st);