(svn r16407) -Fix [FS#2913]: set CargoPacket::source to INVALID_STATION when source station is deleted
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user