File diff r27319:ea7c4a418203 → r27320:a815d811abc1
src/linkgraph/refresh.cpp
Show inline comments
 
@@ -135,28 +135,28 @@ bool LinkRefresher::HandleRefit(CargoID 
 
			refit_it->capacity = mail_capacity;
 
			break; // aircraft have only one vehicle
 
		}
 
	}
 
	return any_refit;
 
}
 

	
 
/**
 
 * Restore capacities and refit_capacities as vehicle might have been able to load now.
 
 */
 
void LinkRefresher::ResetRefit()
 
{
 
	for (RefitList::iterator it(this->refit_capacities.begin()); it != this->refit_capacities.end(); ++it) {
 
		if (it->remaining == it->capacity) continue;
 
		this->capacities[it->cargo] += it->capacity - it->remaining;
 
		it->remaining = it->capacity;
 
	for (auto &it : this->refit_capacities) {
 
		if (it.remaining == it.capacity) continue;
 
		this->capacities[it.cargo] += it.capacity - it.remaining;
 
		it.remaining = it.capacity;
 
	}
 
}
 

	
 
/**
 
 * Predict the next order the vehicle will execute and resolve conditionals by
 
 * recursion and return next non-conditional order in list.
 
 * @param cur Current order being evaluated.
 
 * @param next Next order to be evaluated.
 
 * @param flags RefreshFlags to give hints about the previous link and state carried over from that.
 
 * @param num_hops Number of hops already taken by recursive calls to this method.
 
 * @return new next Order.
 
 */