src/vehicle.cpp
changeset 8567 51dacd0fa180
parent 8560 8472721356cf
child 8568 a82225425c24
equal deleted inserted replaced
8566:94fb2c4351dd 8567:51dacd0fa180
   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()