diff --git a/src/thor/bidirectional_astar.cc b/src/thor/bidirectional_astar.cc index 9fa73b9b66..1d31b9bef2 100644 --- a/src/thor/bidirectional_astar.cc +++ b/src/thor/bidirectional_astar.cc @@ -365,7 +365,7 @@ inline bool BidirectionalAStar::ExpandInner(baldr::GraphReader& graphreader, // we've just added this edge to the queue, but we won't expand from it if it's a not-thru edge that // will be pruned. In that case we want to allow uturns. - return not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru()); + return !(pred.not_thru_pruning() && meta.edge->not_thru()); } template @@ -428,10 +428,10 @@ void BidirectionalAStar::Expand(baldr::GraphReader& graphreader, uturn_meta = is_uturn ? meta : uturn_meta; // Expand but only if this isnt the uturn, we'll try that later if nothing else works out - disable_uturn = - !is_uturn && ExpandInner(graphreader, pred, opp_pred_edge, nodeinfo, - pred_idx, meta, shortcuts, tile, offset_time) || - disable_uturn; + disable_uturn = (!is_uturn && ExpandInner(graphreader, pred, opp_pred_edge, + nodeinfo, pred_idx, meta, + shortcuts, tile, offset_time)) || + disable_uturn; } // Handle transitions - expand from the end node of each transition diff --git a/src/thor/costmatrix.cc b/src/thor/costmatrix.cc index 12304abe57..b260177e41 100644 --- a/src/thor/costmatrix.cc +++ b/src/thor/costmatrix.cc @@ -552,7 +552,7 @@ bool CostMatrix::ExpandInner(baldr::GraphReader& graphreader, pred_dist, newcost.cost); } - return not_thru_pruning_ && !(pred.not_thru_pruning() && meta.edge->not_thru()); + return !(pred.not_thru_pruning() && meta.edge->not_thru()); } template diff --git a/src/thor/timedistancematrix.cc b/src/thor/timedistancematrix.cc index db4e0774a8..c8abb4a633 100644 --- a/src/thor/timedistancematrix.cc +++ b/src/thor/timedistancematrix.cc @@ -151,7 +151,7 @@ void TimeDistanceMatrix::Expand(GraphReader& graphreader, uint32_t idx = edgelabels_.size(); if (FORWARD) { edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_, - path_distance, restriction_idx, false, + path_distance, restriction_idx, (pred.closure_pruning() || !(costing_->IsClosed(directededge, tile))), 0 != (flow_sources & kDefaultFlowMask), costing_->TurnType(pred.opp_local_idx(), nodeinfo, directededge), 0, @@ -159,7 +159,7 @@ void TimeDistanceMatrix::Expand(GraphReader& graphreader, (costing_->is_hgv() && directededge->destonly_hgv())); } else { edgelabels_.emplace_back(pred_idx, edgeid, directededge, newcost, newcost.cost, mode_, - path_distance, restriction_idx, false, + path_distance, restriction_idx, (pred.closure_pruning() || !(costing_->IsClosed(opp_edge, t2))), 0 != (flow_sources & kDefaultFlowMask), costing_->TurnType(directededge->localedgeidx(), nodeinfo, opp_edge, diff --git a/valhalla/sif/costfactory.h b/valhalla/sif/costfactory.h index a512f59720..56b79de7e3 100644 --- a/valhalla/sif/costfactory.h +++ b/valhalla/sif/costfactory.h @@ -101,6 +101,7 @@ class CostFactory { mode_costing_t CreateModeCosting(const Options& options, TravelMode& mode) { mode_costing_t mode_costing; + mode = TravelMode::kMaxTravelMode; // Set travel mode and construct costing(s) for this type for (const auto& costing : kCostingTypeMapping.at(options.costing_type())) { valhalla::sif::cost_ptr_t cost = Create(options.costings().find(costing)->second);