From cd7a1d7a399de1d4a34da20e0a93e06e15a7d5cc Mon Sep 17 00:00:00 2001 From: Pablo Hoch Date: Mon, 12 Feb 2024 16:03:43 +0100 Subject: [PATCH] Fix stairs direction (#58) --- src/routing/costs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routing/costs.cc b/src/routing/costs.cc index 4ebe9c1..72750d6 100644 --- a/src/routing/costs.cc +++ b/src/routing/costs.cc @@ -242,8 +242,8 @@ edge_costs get_edge_costs(routing_graph_data const& rg, edge const* e, if (info->street_type_ == street_type::STAIRS) { auto const steps = edge_step_count(rg, e); - auto const& cf = - get_stairs_factor(profile, info->incline_up_, info->handrail_); + auto const incline_up = fwd ? info->incline_up_ : !info->incline_up_; + auto const& cf = get_stairs_factor(profile, incline_up, info->handrail_); add_factor(cf, steps); } else if (info->street_type_ == street_type::ESCALATOR) { add_factor(profile.escalator_cost_, distance);