Changeset - r20319:93ee17237324
[Not reviewed]
master
0 1 0
fonsinchen - 11 years ago 2013-06-07 22:12:39
fonsinchen@openttd.org
(svn r25329) -Fix [FS#5582]: for refreshing next hops implicit orders are equivalent to explicit stopping orders
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -2122,13 +2122,13 @@ void Vehicle::RefreshNextHopsStats()
 
	uint hops = 0;
 
	const Order *first = this->GetOrder(this->cur_implicit_order_index);
 
	do {
 
		/* Make sure the first order is a station order. */
 
		first = this->orders.list->GetNextStoppingOrder(this, first, hops++);
 
		if (first == NULL) return;
 
	} while (!first->IsType(OT_GOTO_STATION));
 
	} while (!first->IsType(OT_GOTO_STATION) && !first->IsType(OT_IMPLICIT));
 
	hops = 0;
 

	
 
	const Order *cur = first;
 
	const Order *next = first;
 
	while (next != NULL && cur->CanLeaveWithCargo(true)) {
 
		next = this->orders.list->GetNextStoppingOrder(this,
 
@@ -2178,13 +2178,13 @@ void Vehicle::RefreshNextHopsStats()
 
					}
 
					break; // aircraft have only one vehicle
 
				}
 
			}
 
		}
 

	
 
		if (next->IsType(OT_GOTO_STATION)) {
 
		if (next->IsType(OT_GOTO_STATION) || next->IsType(OT_IMPLICIT)) {
 
			StationID next_station = next->GetDestination();
 
			Station *st = Station::GetIfValid(cur->GetDestination());
 
			if (st != NULL && next_station != INVALID_STATION && next_station != st->index) {
 
				for (const SmallPair<CargoID, uint> *i = capacities.Begin(); i != capacities.End(); ++i) {
 
					/* Refresh the link and give it a minimum capacity. */
 
					if (i->second > 0) IncreaseStats(st, i->first, next_station, i->second, UINT_MAX);
0 comments (0 inline, 0 general)