The role of maternal effects in adaptation to different diets