Parse as float to avoid issues with custom user input

This commit is contained in:
Victor Shcherb 2019-03-18 15:58:18 +01:00
parent 5341defd89
commit f89bae4595

View file

@ -92,7 +92,7 @@ public class TransportRoutingConfiguration {
maxRouteTime = router.getIntAttribute("maxRouteTime", maxRouteTime);
finishTimeSeconds = router.getIntAttribute("delayForAlternativesRoutes", finishTimeSeconds);
String mn = params.get("max_num_changes");
maxNumberOfChanges = RoutingConfiguration.parseSilentInt(mn, maxNumberOfChanges);
maxNumberOfChanges = (int) RoutingConfiguration.parseSilentFloat(mn, maxNumberOfChanges);
walkSpeed = router.getFloatAttribute("minDefaultSpeed", this.walkSpeed * 3.6f) / 3.6f;
defaultTravelSpeed = router.getFloatAttribute("maxDefaultSpeed", this.defaultTravelSpeed * 3.6f) / 3.6f;