(svn r16475) -Codechange: move code invalidating Vehicle::last_station_visited to more logical place

This commit is contained in:
smatz
2009-05-31 09:33:12 +00:00
parent 0eaec8edca
commit ab5a51d462
2 changed files with 8 additions and 5 deletions

View File

@@ -75,6 +75,14 @@ Station::~Station()
if (a->targetairport == this->index) a->targetairport = INVALID_STATION;
}
Vehicle *v;
FOR_ALL_VEHICLES(v) {
/* Forget about this station if this station is removed */
if (v->last_station_visited == destination && type == OT_GOTO_STATION) {
v->last_station_visited = INVALID_STATION;
}
}
MarkDirty();
InvalidateWindowData(WC_STATION_LIST, this->owner, 0);