diff src/station_cmd.cpp @ 6261:a2ab35efe1ab draft

(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
author truelight <truelight@openttd.org>
date Thu, 08 Mar 2007 20:50:27 +0000 (2007-03-08)
parents 4a39d6291d58
children aa94b177ca9a
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2210,6 +2210,12 @@
 
 	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 @@
 		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;
 	}