summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saveload/station_sl.cpp2
-rw-r--r--src/station_base.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index a6de95dd0..17fcc58bd 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -541,7 +541,7 @@ static void Load_STNN()
for (uint32 j = 0; j < _num_flows; ++j) {
SlObject(&flow, _flow_desc);
if (fs == NULL || prev_source != flow.source) {
- fs = &(st->goods[i].flows.insert(std::make_pair(flow.source, FlowStat(flow.via, flow.share))).first->second);
+ fs = &(st->goods[i].flows.insert(std::make_pair(flow.source, FlowStat(flow.via, flow.share, flow.restricted))).first->second);
} else {
fs->AppendShare(flow.via, flow.share, flow.restricted);
}
diff --git a/src/station_base.h b/src/station_base.h
index 944a731f2..6d6522840 100644
--- a/src/station_base.h
+++ b/src/station_base.h
@@ -48,12 +48,13 @@ public:
* Create a FlowStat with an initial entry.
* @param st Station the initial entry refers to.
* @param flow Amount of flow for the initial entry.
+ * @param restricted If the flow to be added is restricted.
*/
- inline FlowStat(StationID st, uint flow)
+ inline FlowStat(StationID st, uint flow, bool restricted = false)
{
assert(flow > 0);
this->shares[flow] = st;
- this->unrestricted = flow;
+ this->unrestricted = restricted ? 0 : flow;
}
/**