vehicle.c
changeset 4675 61585e778cc8
parent 4673 a2cdac5529f7
child 4676 e58dba0b7093
equal deleted inserted replaced
4674:206973351c4a 4675:61585e778cc8
  1727 		if ((vehicle_type == VEH_Train    && !CheckTrainInDepot(v, false)) ||
  1727 		if ((vehicle_type == VEH_Train    && !CheckTrainInDepot(v, false)) ||
  1728 			(vehicle_type == VEH_Road     && !IsRoadVehInDepot(v)        ) ||
  1728 			(vehicle_type == VEH_Road     && !IsRoadVehInDepot(v)        ) ||
  1729 			(vehicle_type == VEH_Ship     && !IsShipInDepot(v)           ) ||
  1729 			(vehicle_type == VEH_Ship     && !IsShipInDepot(v)           ) ||
  1730 			(vehicle_type == VEH_Aircraft && !IsAircraftInHangar(v))     ) continue;
  1730 			(vehicle_type == VEH_Aircraft && !IsAircraftInHangar(v))     ) continue;
  1731 
  1731 
  1732 		if (stopped) v->vehstatus &= ~VS_STOPPED; // Stop the vehicle
  1732 		if (stopped) v->vehstatus |= VS_STOPPED; // Stop the vehicle
  1733 		ret = MaybeReplaceVehicle(&v, !(flags & DC_EXEC), false);
  1733 		ret = MaybeReplaceVehicle(&v, !(flags & DC_EXEC), false);
  1734 		if (stopped) v->vehstatus |= VS_STOPPED; // restart the vehicle if we stopped it for being replaced
  1734 		if (stopped) v->vehstatus &= ~VS_STOPPED; // restart the vehicle if we stopped it for being replaced
  1735 
  1735 
  1736 		if (!CmdFailed(ret)) {
  1736 		if (!CmdFailed(ret)) {
  1737 			cost += ret;
  1737 			cost += ret;
  1738 			if (!(flags & DC_EXEC)) break;
  1738 			if (!(flags & DC_EXEC)) break;
  1739 			x = v->x_pos;
  1739 			x = v->x_pos;