From f15dcf1d690a110aefa82295534007630544e187 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 28 Feb 2022 18:10:36 +0100 Subject: [PATCH] [MIRROR] Adds a seperate pick proc to work on lists [MDB IGNORE] (#11779) * Adds a seperate pick proc to work on lists (#65178) Because of how arglist() works, _pick was only working on args matching the format pick(1, 2 ,3) Because this is logic that happens inside pick itself, and I can't figure out the proper way to actually pass things in, I've created _pick_list so admins have a sane way to pick from lists. * Adds a seperate pick proc to work on lists Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> --- code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm index be10e2b3666..e9816d89c4c 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm @@ -123,6 +123,16 @@ /proc/_pick(...) return pick(arglist(args)) +/// Allow me to explain +/// for some reason, if pick() is passed arglist(args) directly and args contains only one list +/// it considers it to be a list of lists +/// this means something like _pick(list) would fail +/// need to do this instead +/// +/// I hate this timeline +/proc/_pick_list(list/pick_from) + return pick(pick_from) + /proc/_prob(P) return prob(P)