summaryrefslogtreecommitdiff
path: root/src/cargopacket.cpp
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-10-23 19:04:06 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-10-23 19:04:06 +0000
commitf528d2c59246cb76c5d84dfac04e84e1368ea650 (patch)
tree40eba275e45bb75a02c6b9ca026755f7707eb4b4 /src/cargopacket.cpp
parentb5dd83e84f355eedbfc78838c0961864cd7a8fb1 (diff)
downloadopenttd-f528d2c59246cb76c5d84dfac04e84e1368ea650.tar.xz
(svn r25910) -Fix: Guard against empty FlowStats in a few more places.
Diffstat (limited to 'src/cargopacket.cpp')
-rw-r--r--src/cargopacket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp
index 3820d8c77..54cc9b7f7 100644
--- a/src/cargopacket.cpp
+++ b/src/cargopacket.cpp
@@ -478,7 +478,7 @@ bool VehicleCargoList::Stage(bool accepted, StationID current_station, StationID
FlowStat new_shares = flow_it->second;
new_shares.ChangeShare(current_station, INT_MIN);
StationIDStack excluded = next_station;
- while (!excluded.IsEmpty()) {
+ while (!excluded.IsEmpty() && !new_shares.GetShares()->empty()) {
new_shares.ChangeShare(excluded.Pop(), INT_MIN);
}
if (new_shares.GetShares()->empty()) {