Changeset - r21472:fd9e339929aa
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-05-11 18:31:38
rubidium@openttd.org
(svn r26581) -Fix [FS#5989]: transfering cargo to a station doesn't give that station a rating and thus the cargo does not decay... until the first pickup happens
For cargo drops from industries/houses, the station gets a rating too so why not when cargo is dropped at the station from a train?
1 file changed with 13 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -1558,8 +1558,18 @@ static void LoadUnloadVehicle(Vehicle *f
 
				}
 
			}
 

	
 
			/* Mark the station dirty if we transfer, but not if we only deliver. */
 
			dirty_station = v->cargo.ActionCount(VehicleCargoList::MTA_TRANSFER) > 0;
 
			if (v->cargo.ActionCount(VehicleCargoList::MTA_TRANSFER) > 0) {
 
				/* Mark the station dirty if we transfer, but not if we only deliver. */
 
				dirty_station = true;
 

	
 
				if (!ge->HasRating()) {
 
					/* Upon transfering cargo, make sure the station has a rating. Fake a pickup for the
 
					 * first unload to prevent the cargo from quickly decaying after the initial drop. */
 
					ge->time_since_pickup = 0;
 
					SetBit(ge->status, GoodsEntry::GES_RATING);
 
				}
 
			}
 

	
 
			amount_unloaded = v->cargo.Unload(amount_unloaded, &ge->cargo, payment);
 
			remaining = v->cargo.UnloadCount() > 0;
 
			if (amount_unloaded > 0) {
 
@@ -1758,6 +1768,7 @@ static void LoadUnloadVehicle(Vehicle *f
 
	if (dirty_station) {
 
		st->MarkTilesDirty(true);
 
		SetWindowDirty(WC_STATION_VIEW, last_visited);
 
		InvalidateWindowData(WC_STATION_LIST, last_visited);
 
	}
 
}
 

	
0 comments (0 inline, 0 general)