summaryrefslogtreecommitdiff
path: root/src/cargopacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cargopacket.cpp')
-rw-r--r--src/cargopacket.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp
index 313e7db4f..e9b3f5064 100644
--- a/src/cargopacket.cpp
+++ b/src/cargopacket.cpp
@@ -62,6 +62,18 @@ CargoPacket::CargoPacket(uint16 count, byte days_in_transit, Money feeder_share,
}
}
+/**
+ * Invalidates (sets source to INVALID_STATION) all cargo packets from given station
+ * @param sid the station that gets removed
+ */
+/* static */ void CargoPacket::InvalidateAllFrom(StationID sid)
+{
+ CargoPacket *cp;
+ FOR_ALL_CARGOPACKETS(cp) {
+ if (cp->source == sid) cp->source_id = INVALID_SOURCE;
+ }
+}
+
/*
*
* Cargo list implementation