[LuaDoc] mathx.random_choice can return nil if the input list is empty
This commit is contained in:
parent
121f0a3cac
commit
e644613cae
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ print("Loading mathx module...")
|
|||
---@param possible_values string|table Either a comma-separated list of values (which can contain integer ranges like 2-7)
|
||||
---or an array of possible values (which can also contain integer ranges as subtables with {lo, hi} elements)
|
||||
---@param random_func? fun(a:integer,b:integer):number
|
||||
---@return number|string
|
||||
---@return number|string|nil
|
||||
function mathx.random_choice(possible_values, random_func)
|
||||
random_func = random_func or mathx.random
|
||||
assert(type(possible_values) == "table" or type(possible_values) == "string",
|
||||
|
|
Loading…
Add table
Reference in a new issue