summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp8
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);
+ }
}
}
}