Changeset - r20679:d88d6338880e
[Not reviewed]
master
0 1 0
fonsinchen - 11 years ago 2013-08-11 10:59:47
fonsinchen@openttd.org
(svn r25717) -Fix: check for type of order before checking for refit type
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -2158,13 +2158,14 @@ void Vehicle::RefreshNextHopsStats()
 

	
 
		/* If the refit cargo is CT_AUTO_REFIT, we're optimistic and assume the
 
		 * cargo will stay the same. The point of this method is to avoid
 
		 * deadlocks due to vehicles waiting for cargo that isn't being routed,
 
		 * yet. That situation will not occur if the vehicle is actually
 
		 * carrying a different cargo in the end. */
 
		if (next->IsRefit() && !next->IsAutoRefit()) {
 
		if ((next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_GOTO_STATION)) &&
 
				next->IsRefit() && !next->IsAutoRefit()) {
 
			was_refit = true;
 
			CargoID new_cid = next->GetRefitCargo();
 
			RefitList::iterator refit_it = refit_capacities.begin();
 
			for (Vehicle *v = this; v != NULL; v = v->Next()) {
 
				const Engine *e = Engine::Get(v->engine_type);
 
				if (!HasBit(e->info.refit_mask, new_cid)) {
0 comments (0 inline, 0 general)