From 8a7f8c9bc6c0a69e1d201b620c1458ef151a98aa Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Tue, 31 Oct 2017 07:07:57 -0700 Subject: [PATCH] Fixes admin buildmode stripping people naked yet again, adds GetAllContentsIgnoring (#31769) * Add GetAllContentsIgnoring which accepts an ignore typecache to ignore * Update turf.dm * fixes * Update unsorted.dm * Update turf.dm --- code/__HELPERS/unsorted.dm | 13 +++++++++++++ code/game/turfs/turf.dm | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index c9b392ed76..6b3c03b180 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -518,6 +518,19 @@ Turf and target are separate in case you want to teleport some distance from a t assembled += A return assembled +/atom/proc/GetAllContentsIgnoring(list/ignore_typecache) + if(!ignore_typecache) + return GetAllContents() + var/list/processing = list(src) + var/list/assembled = list() + while(processing.len) + var/atom/A = processing[1] + processing.Cut(1,2) + if(!ignore_typecache[A.type]) + processing += A.contents + assembled += A + return assembled + //Step-towards method of determining whether one atom can see another. Similar to viewers() /proc/can_see(atom/source, atom/target, length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate. var/turf/current = get_turf(source) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 40c026a7cb..815ee91520 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -440,7 +440,7 @@ /turf/proc/empty(turf_type=/turf/open/space, baseturf_type, list/ignore_typecache, forceop = FALSE) // Remove all atoms except observers, landmarks, docking ports var/static/list/ignored_atoms = typecacheof(list(/mob/dead, /obj/effect/landmark, /obj/docking_port, /atom/movable/lighting_object)) - var/list/allowed_contents = typecache_filter_list_reverse(GetAllContents(), ignored_atoms | ignore_typecache) + var/list/allowed_contents = typecache_filter_list_reverse(GetAllContentsIgnoring(ignore_typecache), ignored_atoms) allowed_contents -= src for(var/i in 1 to allowed_contents.len) var/thing = allowed_contents[i]