diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-06-11 13:39:13 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-06-11 13:39:13 -0400 |
commit | eae45eefb55410782559b4ace5350b2a99f63234 (patch) | |
tree | 90744b7e84e3e2b71880cab923508655bd8e64d3 /indra/newview | |
parent | 9b7d71cdfc09e9d49a2bbd44a010086b37ab78b4 (diff) |
mapargs() now accepts 'name1,name2,...' as argument names
in addition to a list {'name1', 'name2', ...}.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/scripts/lua/mapargs.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/mapargs.lua b/indra/newview/scripts/lua/mapargs.lua index 78e691d8bc..45f5a9c556 100644 --- a/indra/newview/scripts/lua/mapargs.lua +++ b/indra/newview/scripts/lua/mapargs.lua @@ -21,6 +21,12 @@ local function mapargs(names, ...) -- array items it contains, if there are any holes. Track that by hand. -- We must be able to handle f(1, nil, 3) calls. local maxpos = 0 + + -- For convenience, allow passing 'names' as a string 'n0,n1,...' + if type(names) == 'string' then + names = string.split(names, ',') + end + if not (args.n == 1 and type(args[1]) == 'table') then -- If caller passes more than one argument, or if the first argument -- is not a table, then it's classic positional function-call syntax: |