From c0d4c30711810c93946b50609238da20a599d049 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Tue, 3 Mar 2020 14:57:32 +0100 Subject: [PATCH] Update _lists.dm --- code/__HELPERS/_lists.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 8e44b57396..f16b566b00 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -174,6 +174,15 @@ L[T] = TRUE return L +/proc/typecacheof_assoc_list(list/pathlist, ignore_root_path = FALSE) + . = list() + if(!istype(pathlist)) + return + for(var/P in pathlist) + var/value = pathlist[P] + for(var/T in (ignore_root_path ? subtypesof(P) : typesof(P))) + .[T] = value + //Empties the list by setting the length to 0. Hopefully the elements get garbage collected /proc/clearlist(list/list) if(istype(list)) @@ -579,4 +588,4 @@ var/list/ret = list() for(var/key in input) ret += key - return ret \ No newline at end of file + return ret