Fixes the Birminingham speed limit bug reported by Philip Barnes
This commit is contained in:
parent
8ab5915983
commit
7c54d4e62f
@ -64,13 +64,14 @@ local function parse_maxspeed(source)
|
|||||||
if source == nil then
|
if source == nil then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
local n = tonumber(source)
|
local n = tonumber(source:match("%d*"))
|
||||||
if n == nil then
|
if n == nil then
|
||||||
n = 0
|
n = 0
|
||||||
end
|
end
|
||||||
if string.match(source, "mph") or string.match(source, "mp/h") then
|
if string.match(source, "mph") or string.match(source, "mp/h") then
|
||||||
n = (n*1609)/1000;
|
n = (n*1609)/1000;
|
||||||
end
|
end
|
||||||
|
io.write("speed: "..n.."\n")
|
||||||
return math.abs(n)
|
return math.abs(n)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user