Merge branch 'cargo_type_order' into jgrpp

# Conflicts:
#	src/order_base.h
#	src/order_gui.cpp
#	src/order_type.h
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/vehicle_base.h
This commit is contained in:
Jonathan G Rennison
2016-09-08 00:12:48 +01:00
19 changed files with 1079 additions and 159 deletions

View File

@@ -3695,28 +3695,6 @@ void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint c
}
}
/**
* Increase capacity for all link stats associated with vehicles in the given consist.
* @param st Station to get the link stats from.
* @param front First vehicle in the consist.
* @param next_station_id Station the consist will be travelling to next.
*/
void IncreaseStats(Station *st, const Vehicle *front, StationID next_station_id)
{
for (const Vehicle *v = front; v != NULL; v = v->Next()) {
if (v->refit_cap > 0) {
/* The cargo count can indeed be higher than the refit_cap if
* wagons have been auto-replaced and subsequently auto-
* refitted to a higher capacity. The cargo gets redistributed
* among the wagons in that case.
* As usage is not such an important figure anyway we just
* ignore the additional cargo then.*/
IncreaseStats(st, v->cargo_type, next_station_id, v->refit_cap,
min(v->refit_cap, v->cargo.StoredCount()), EUM_INCREASE);
}
}
}
/* called for every station each tick */
static void StationHandleSmallTick(BaseStation *st)
{