diff options
author | truelight <truelight@openttd.org> | 2007-03-08 20:50:27 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-03-08 20:50:27 +0000 |
commit | ca375d573acf9ac860edf23c831ae78bd0872dec (patch) | |
tree | 3303d93ea0c78b4ea82fdba0810ff0ba310e5d79 | |
parent | 900fcaa2fac97e26127f799c4e39ef29ab461c17 (diff) | |
download | openttd-ca375d573acf9ac860edf23c831ae78bd0872dec.tar.xz |
(svn r9070) -Fix [FS#404]: if bribe failed and you didn't pick up cargo yet, you wouldn't ever be able to do so for a given station
-rw-r--r-- | src/station.h | 3 | ||||
-rw-r--r-- | src/station_cmd.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/station.h b/src/station.h index bced6a2be..3a4ef31cf 100644 --- a/src/station.h +++ b/src/station.h @@ -11,13 +11,14 @@ #include "newgrf_station.h" static const StationID INVALID_STATION = 0xFFFF; +static const byte INITIAL_STATION_RATING = 175; struct GoodsEntry { GoodsEntry() : waiting_acceptance(0), unload_pending(0), days_since_pickup(0), - rating(175), + rating(INITIAL_STATION_RATING), enroute_from(INVALID_STATION), enroute_from_xy(INVALID_TILE), last_speed(0), diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 77cd046f7..35e362b11 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2210,6 +2210,12 @@ static void UpdateStationRating(Station *st) GoodsEntry *ge = st->goods; do { + /* Slowly increase the rating back to his original level in the case we + * didn't deliver cargo yet to this station. This happens when a bribe + * failed while you didn't moved that cargo yet to a station. */ + if (ge->enroute_from == INVALID_STATION && ge->rating < INITIAL_STATION_RATING) + ge->rating++; + /* Only change the rating if we are moving this cargo */ if (ge->enroute_from != INVALID_STATION) { byte_inc_sat(&ge->enroute_time); byte_inc_sat(&ge->days_since_pickup); @@ -2546,7 +2552,7 @@ void BuildOilRig(TileIndex tile) st->goods[j].days_since_pickup = 0; st->goods[j].enroute_from = INVALID_STATION; st->goods[j].enroute_from_xy = INVALID_TILE; - st->goods[j].rating = 175; + st->goods[j].rating = INITIAL_STATION_RATING; st->goods[j].last_speed = 0; st->goods[j].last_age = 255; } |