Use lua 5.2+ without needing compatibility flags.
This commit is contained in:
committed by
Patrick Niklaus
parent
407036e215
commit
566ab993df
@@ -1,13 +1,15 @@
|
||||
local ipairs = ipairs
|
||||
|
||||
module "Access"
|
||||
local Access = {}
|
||||
|
||||
function find_access_tag(source,access_tags_hierachy)
|
||||
function Access.find_access_tag(source,access_tags_hierachy)
|
||||
for i,v in ipairs(access_tags_hierachy) do
|
||||
local tag = source:get_value_by_key(v)
|
||||
if tag and tag ~= '' then
|
||||
return tag
|
||||
end
|
||||
end
|
||||
return nil
|
||||
return ""
|
||||
end
|
||||
|
||||
return Access
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
local math = math
|
||||
|
||||
module "MaxSpeed"
|
||||
local MaxSpeed = {}
|
||||
|
||||
function limit(way,max,maxf,maxb)
|
||||
function MaxSpeed.limit(way,max,maxf,maxb)
|
||||
if maxf and maxf>0 then
|
||||
way.forward_speed = math.min(way.forward_speed, maxf)
|
||||
elseif max and max>0 then
|
||||
@@ -15,3 +15,5 @@ function limit(way,max,maxf,maxb)
|
||||
way.backward_speed = math.min(way.backward_speed, max)
|
||||
end
|
||||
end
|
||||
|
||||
return MaxSpeed
|
||||
|
||||
Reference in New Issue
Block a user