From f662ff6845d8bbe31cc52ff79f70fba3b19a9f18 Mon Sep 17 00:00:00 2001 From: rebos <490798+rebos@users.noreply.github.com> Date: Wed, 14 Apr 2021 12:12:28 +0200 Subject: [PATCH 1/2] Convert maxheight to number if possible --- 5/21/truck-soft/car.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5/21/truck-soft/car.lua b/5/21/truck-soft/car.lua index 27d77fc..3fdc523 100644 --- a/5/21/truck-soft/car.lua +++ b/5/21/truck-soft/car.lua @@ -350,7 +350,7 @@ function process_node(profile, node, result, relations) local restricted_by_height = false if barrier == 'height_restrictor' then local maxheight = Measure.get_max_height(node:get_value_by_key("maxheight"), node) - restricted_by_height = maxheight and maxheight < profile.vehicle_height + restricted_by_height = maxheight and tonumber(maxheight) and tonumber(maxheight) < profile.vehicle_height end -- make an exception for rising bollard barriers From 65b2a1a97860322ca8987ec3b2403011abb5cb2d Mon Sep 17 00:00:00 2001 From: rebos <490798+rebos@users.noreply.github.com> Date: Wed, 14 Apr 2021 12:25:36 +0200 Subject: [PATCH 2/2] Convert forward and backward to number if possible --- 5/21/truck-soft/lib/way_handlers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/5/21/truck-soft/lib/way_handlers.lua b/5/21/truck-soft/lib/way_handlers.lua index 356cf57..cc39f22 100644 --- a/5/21/truck-soft/lib/way_handlers.lua +++ b/5/21/truck-soft/lib/way_handlers.lua @@ -480,11 +480,11 @@ function WayHandlers.handle_height(profile,way,result,data) forward = Measure.get_max_height(forward,way) backward = Measure.get_max_height(backward,way) - if forward and forward < profile.vehicle_height then + if forward and tonumber(forward) and tonumber(forward) < profile.vehicle_height then result.forward_mode = mode.inaccessible end - if backward and backward < profile.vehicle_height then + if backward and tonumber(backward) and tonumber(backward) < profile.vehicle_height then result.backward_mode = mode.inaccessible end end