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
This commit is contained in:
kevinz000
2017-10-31 07:07:57 -07:00
committed by CitadelStationBot
parent 31e2303e39
commit 8a7f8c9bc6
2 changed files with 14 additions and 1 deletions

View File

@@ -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)

View File

@@ -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]