diff options
author | fonsinchen <fonsinchen@openttd.org> | 2013-10-22 16:13:28 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2013-10-22 16:13:28 +0000 |
commit | 29e987f3fc13dc1e2a90f07556bf033b81a13e36 (patch) | |
tree | c8f1abf4c61c5c7994792b231ead35f2910559e8 /src/vehicle.cpp | |
parent | ec2d36a4a40646e260f4fbcdcd984e278ce8387a (diff) | |
download | openttd-29e987f3fc13dc1e2a90f07556bf033b81a13e36.tar.xz |
(svn r25898) -Codechange: Add second timestamp for 'restricted links' to all edges.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 3d9da8447..0abe6689d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -50,6 +50,7 @@ #include "tunnel_map.h" #include "depot_map.h" #include "gamelog.h" +#include "linkgraph/linkgraph.h" #include "table/strings.h" @@ -2267,7 +2268,12 @@ uint Vehicle::RefreshNextHopsStats(CapacitiesMap &capacities, if (st != NULL && next_station != INVALID_STATION && next_station != st->index) { for (CapacitiesMap::const_iterator 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); + if (i->second > 0) { + /* A link is at least partly restricted if a + * vehicle can't load at its source. */ + IncreaseStats(st, i->first, next_station, i->second, + (cur->GetLoadType() & OLFB_NO_LOAD) == 0 ? LinkGraph::REFRESH_UNRESTRICTED : LinkGraph::REFRESH_RESTRICTED); + } } } } |