1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-02 03:19:10 +00:00

(svn r11314) -Fix [FS#1356]: stop following a vehicle when you sell/destroyed it.

This commit is contained in:
rubidium
2007-10-20 17:11:02 +00:00
parent 5289aa2010
commit 79cee7e08f

View File

@@ -529,6 +529,14 @@ void Vehicle::PreDestructor()
if ((this->type == VEH_TRAIN && EngineHasArticPart(this)) || (this->type == VEH_ROAD && RoadVehHasArticPart(this))) {
delete this->Next();
}
Window **wp;
FOR_ALL_WINDOWS(wp) {
Window *w = *wp;
if (w->viewport != NULL && WP(w, vp_d).follow_vehicle == this->index) {
WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
}
}
}
Vehicle::~Vehicle()