(svn r16407) -Fix [FS#2913]: set CargoPacket::source to INVALID_STATION when source station is deleted

This commit is contained in:
smatz
2009-05-23 19:43:09 +00:00
parent c1861060f7
commit bebab3cd79
3 changed files with 23 additions and 9 deletions

View File

@@ -101,6 +101,12 @@ Station::~Station()
for (CargoID c = 0; c < NUM_CARGO; c++) {
goods[c].cargo.Truncate(0);
}
CargoPacket *cp;
FOR_ALL_CARGOPACKETS(cp) {
/* Don't allow cargo packets with invalid source station */
if (cp->source == this->index) cp->source = INVALID_STATION;
}
}