src/depot_gui.cpp
changeset 7269 c7f39d91255e
parent 7134 c5a90dd41166
child 7353 716c6dd9322a
equal deleted inserted replaced
7268:9c77f6baef3b 7269:c7f39d91255e
   486 {
   486 {
   487 	uint error_str;
   487 	uint error_str;
   488 
   488 
   489 	if (v == NULL) return;
   489 	if (v == NULL) return;
   490 
   490 
   491 	if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
   491 	if (v->HasFront() && !v->IsPrimaryVehicle()) {
   492 		v = GetFirstVehicleInChain(v);
   492 		v = GetFirstVehicleInChain(v);
   493 		/* Do nothing when clicking on a train in depot with no loc attached */
   493 		/* Do nothing when clicking on a train in depot with no loc attached */
   494 		if (!IsFrontEngine(v)) return;
   494 		if (v->type == VEH_TRAIN && !IsFrontEngine(v)) return;
   495 	}
   495 	}
   496 
   496 
   497 	switch (v->type) {
   497 	switch (v->type) {
   498 		case VEH_TRAIN:    error_str = CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE); break;
   498 		case VEH_TRAIN:    error_str = CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE); break;
   499 		case VEH_ROAD:     error_str = CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE);     break;
   499 		case VEH_ROAD:     error_str = CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE);     break;