mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
aba867d78d
commit
c19b8c72b7
|
@ -222,7 +222,9 @@ enum CatchmentArea {
|
||||||
CA_BUS = 3,
|
CA_BUS = 3,
|
||||||
CA_TRUCK = 3,
|
CA_TRUCK = 3,
|
||||||
CA_TRAIN = 4,
|
CA_TRAIN = 4,
|
||||||
CA_DOCK = 5
|
CA_DOCK = 5,
|
||||||
|
|
||||||
|
MAX_CATCHMENT = 10, ///< Airports have a catchment up to this number.
|
||||||
};
|
};
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
||||||
|
|
|
@ -2597,9 +2597,9 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount)
|
||||||
if (_patches.modified_catchment) {
|
if (_patches.modified_catchment) {
|
||||||
w_prod = w;
|
w_prod = w;
|
||||||
h_prod = h;
|
h_prod = h;
|
||||||
w += 16;
|
w += 2 * MAX_CATCHMENT;
|
||||||
h += 16;
|
h += 2 * MAX_CATCHMENT;
|
||||||
max_rad = 8;
|
max_rad = MAX_CATCHMENT;
|
||||||
} else {
|
} else {
|
||||||
w_prod = 0;
|
w_prod = 0;
|
||||||
h_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
|
((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) {
|
if (_patches.modified_catchment) {
|
||||||
// min and max coordinates of the producer relative
|
// min and max coordinates of the producer relative
|
||||||
const int x_min_prod = 9;
|
const int x_min_prod = max_rad + 1;
|
||||||
const int x_max_prod = 8 + w_prod;
|
const int x_max_prod = max_rad + w_prod;
|
||||||
const int y_min_prod = 9;
|
const int y_min_prod = max_rad + 1;
|
||||||
const int y_max_prod = 8 + h_prod;
|
const int y_max_prod = max_rad + h_prod;
|
||||||
|
|
||||||
int rad = FindCatchmentRadius(st);
|
int rad = FindCatchmentRadius(st);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue