diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 393c5a465d..c24f93d32a 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -88,16 +88,21 @@ L -= V //No return here so that it removes all strings of that type return -//returns a new list with only atoms that are in typecache L -/proc/typecache_filter_list(list/atoms, list/typecache, reversed=FALSE) + +/proc/typecache_filter_list(list/atoms, list/typecache) . = list() for (var/thing in atoms) var/atom/A = thing - if (typecache[A.type] && !reversed) - . += A - else if(reversed) + if (typecache[A.type]) . += A +/proc/typecache_filter_list_reverse(list/atoms, list/typecache) + . = list() + for (var/thing in atoms) + var/atom/A = thing + if (!typecache[A.type]) + . += A + //Like typesof() or subtypesof(), but returns a typecache instead of a list /proc/typecacheof(path, ignore_root_path, only_root_path = FALSE) if(ispath(path))