File diff r27882:e0b47acdb939 → r27883:ddbd33508a8a
src/linkgraph/refresh.cpp
Show inline comments
 
@@ -225,25 +225,25 @@ void LinkRefresher::RefreshStats(const O
 
			 * to travel between the stations at half the max speed of the consist.
 
			 * The result is in tiles/tick (= 2048 km-ish/h). */
 
			uint32_t time_estimate = DistanceManhattan(st->xy, st_to->xy) * 4096U / this->vehicle->GetDisplayMaxSpeed();
 

	
 
			/* If the vehicle is currently full loading, increase the capacities at the station
 
			 * where it is loading by an estimate of what it would have transported if it wasn't
 
			 * loading. Don't do that if the vehicle has been waiting for longer than the entire
 
			 * order list is supposed to take, though. If that is the case the total duration is
 
			 * probably far off and we'd greatly overestimate the capacity by increasing.*/
 
			if (this->is_full_loading && this->vehicle->orders != nullptr &&
 
					st->index == vehicle->last_station_visited &&
 
					this->vehicle->orders->GetTotalDuration() >
 
					(Ticks)this->vehicle->current_order_time) {
 
					(TimerGameTick::Ticks)this->vehicle->current_order_time) {
 
				uint effective_capacity = cargo_quantity * this->vehicle->load_unload_ticks;
 
				if (effective_capacity > (uint)this->vehicle->orders->GetTotalDuration()) {
 
					IncreaseStats(st, c, next_station, effective_capacity /
 
							this->vehicle->orders->GetTotalDuration(), 0, 0,
 
							EUM_INCREASE | restricted_mode);
 
				} else if (RandomRange(this->vehicle->orders->GetTotalDuration()) < effective_capacity) {
 
					IncreaseStats(st, c, next_station, 1, 0, 0, EUM_INCREASE | restricted_mode);
 
				} else {
 
					IncreaseStats(st, c, next_station, cargo_quantity, 0, time_estimate, EUM_REFRESH | restricted_mode);
 
				}
 
			} else {
 
				IncreaseStats(st, c, next_station, cargo_quantity, 0, time_estimate, EUM_REFRESH | restricted_mode);