2,875
edits
No edit summary |
No edit summary |
||
Line 129: | Line 129: | ||
end | end | ||
-- Stupid shenanigans to filter out numeric parameters. | |||
-- Because just iterating over #args doesn't work for some reason... | |||
function getNumericArgs(args) | function getNumericArgs(args) | ||
local ret = {} | |||
for k, v in pairs(args) do | for k, v in pairs(args) do | ||
k = tonumber(k) | |||
if k then table.insert(ret, v) end | |||
end | end | ||
end | end | ||
Line 140: | Line 145: | ||
function p._main(args) | function p._main(args) | ||
local numParams = getNumericArgs(args) | |||
local obstacleNames = {} | local obstacleNames = {} | ||
for i = 1, | for i = 1, #numParams do | ||
if | if numParams[i] then | ||
table.insert(obstacleNames, | table.insert(obstacleNames, numParams[i]:match("^%s*(.-)%s*$")) | ||
end | end | ||
end | end |
edits