src/vehicle_gui.cpp
changeset 9274 42b67e65f1c2
parent 9273 35e0224ea8f1
child 9297 1cb8d7bbdc8a
equal deleted inserted replaced
9273:35e0224ea8f1 9274:42b67e65f1c2
  2169 		case VEH_SHIP:     DrawShipImage(v, x, y, selection);               break;
  2169 		case VEH_SHIP:     DrawShipImage(v, x, y, selection);               break;
  2170 		case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection);           break;
  2170 		case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection);           break;
  2171 		default: NOT_REACHED();
  2171 		default: NOT_REACHED();
  2172 	}
  2172 	}
  2173 }
  2173 }
       
  2174 
       
  2175 void StopGlobalFollowVehicle(const Vehicle *v)
       
  2176 {
       
  2177 	Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
       
  2178 	if (w != NULL && w->viewport->follow_vehicle == v->index) {
       
  2179 		ScrollMainWindowTo(v->x_pos, v->y_pos, true); // lock the main view on the vehicle's last position
       
  2180 		w->viewport->follow_vehicle = INVALID_VEHICLE;
       
  2181 	}
       
  2182 }