announce mode changes

This commit is contained in:
Emil Tin
2014-08-16 12:27:26 +02:00
parent 6e364ff0ba
commit feaf8711d3
2 changed files with 51 additions and 32 deletions
+8 -1
View File
@@ -85,11 +85,18 @@ void DescriptionFactory::AppendSegment(const FixedPointCoordinate &coordinate,
return;
}
// make sure mode changes are announced, even when there otherwise is no turn
const TurnInstruction turn =
(TurnInstruction::NoTurn == path_point.turn_instruction &&
path_description.front().travel_mode != path_point.travel_mode &&
path_point.segment_duration>0) ? TurnInstruction::GoStraight
: path_point.turn_instruction;
path_description.emplace_back(coordinate,
path_point.name_id,
path_point.segment_duration,
0.f,
path_point.turn_instruction,
turn,
path_point.travel_mode);
}