equal
deleted
inserted
replaced
536 * other artic parts. */ |
536 * other artic parts. */ |
537 if ((this->type == VEH_TRAIN && EngineHasArticPart(this)) || (this->type == VEH_ROAD && RoadVehHasArticPart(this))) { |
537 if ((this->type == VEH_TRAIN && EngineHasArticPart(this)) || (this->type == VEH_ROAD && RoadVehHasArticPart(this))) { |
538 delete this->Next(); |
538 delete this->Next(); |
539 } |
539 } |
540 |
540 |
541 Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index); |
541 Window *w = FindWindowById(WC_MAIN_WINDOW, 0); |
542 if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) { |
542 if (WP(w, vp_d).follow_vehicle == this->index) { |
543 ScrollMainWindowTo(this->x_pos, this->y_pos); // lock the main view on the vehicle's last position |
543 ScrollMainWindowTo(this->x_pos, this->y_pos, true); // lock the main view on the vehicle's last position |
544 WP(w, vp_d).follow_vehicle = INVALID_VEHICLE; |
544 WP(w, vp_d).follow_vehicle = INVALID_VEHICLE; |
545 } |
545 } |
546 } |
546 } |
547 |
547 |
548 Vehicle::~Vehicle() |
548 Vehicle::~Vehicle() |