diff options
author | fonsinchen <fonsinchen@openttd.org> | 2014-05-01 14:50:52 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2014-05-01 14:50:52 +0000 |
commit | 11d98f043e96b7b7d9a2f97b5a7297b641f97c26 (patch) | |
tree | c9836afd3d8978a65c21387502facf184079aed6 /src/station_cmd.cpp | |
parent | b5566ae6ec928ee922a92efaae5b3f542cb62ddc (diff) | |
download | openttd-11d98f043e96b7b7d9a2f97b5a7297b641f97c26.tar.xz |
(svn r26549) -Change: better estimation for link capacities during full load
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 56c79a1ad..8546c4be6 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3505,9 +3505,10 @@ void DeleteStaleLinks(Station *from) * @param cargo Cargo to increase stat for. * @param next_station_id Station the consist will be travelling to next. * @param capacity Capacity to add to link stat. - * @param usage Usage to add to link stat. If UINT_MAX refresh the link instead of increasing. + * @param usage Usage to add to link stat. + * @param mode Update mode to be applied. */ -void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage) +void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage, EdgeUpdateMode mode) { GoodsEntry &ge1 = st->goods[cargo]; Station *st2 = Station::Get(next_station_id); @@ -3549,7 +3550,7 @@ void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint c } } if (lg != NULL) { - (*lg)[ge1.node].UpdateEdge(ge2.node, capacity, usage); + (*lg)[ge1.node].UpdateEdge(ge2.node, capacity, usage, mode); } } @@ -3570,7 +3571,7 @@ void IncreaseStats(Station *st, const Vehicle *front, StationID next_station_id) * 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())); + min(v->refit_cap, v->cargo.StoredCount()), EUM_INCREASE); } } } |