Don't mark all lanes as designated when there are blank lane specifiers in the tag.

This commit is contained in:
Daniel Patterson 2016-10-25 14:22:06 -06:00
parent a933b5d949
commit ceddfada3d
2 changed files with 5 additions and 1 deletions

View File

@ -170,6 +170,8 @@ Feature: Car - Restricted access
| primary | | designated | | -1 | | x | | primary | | designated | | -1 | | x |
| primary | | | designated | yes | | | | primary | | | designated | yes | | |
| primary | | | designated | -1 | | | | primary | | | designated | -1 | | |
| primary | | | designated\| | yes | x | |
| primary | | | designated\| | -1 | | x |
| primary | | | designated\|designated | yes | | | | primary | | | designated\|designated | yes | | |
| primary | | | designated\|designated | -1 | | | | primary | | | designated\|designated | -1 | | |
| primary | | | designated\|yes | yes | x | | | primary | | | designated\|yes | yes | x | |

View File

@ -261,7 +261,9 @@ function way_function (way, result)
-- also respect user-preference for HOV-only ways when all lanes are HOV-designated -- also respect user-preference for HOV-only ways when all lanes are HOV-designated
local function has_all_designated_hov_lanes(lanes) local function has_all_designated_hov_lanes(lanes)
local all = true local all = true
for lane in lanes:gmatch("(%w+)") do -- This gmatch call effectively splits the string on | chars.
-- we append an extra | to the end so that we can match the final part
for lane in (lanes .. '|'):gmatch("([^|]*)|") do
if lane and lane ~= "designated" then if lane and lane ~= "designated" then
all = false all = false
break break