Merge pull request #3814 from Citadel-Station-13/upstream-merge-32411
[MIRROR] removes search_contents_for proc
This commit is contained in:
@@ -152,13 +152,14 @@
|
||||
if(istype(teleatom, /obj/item/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
var/list/bagholding = teleatom.search_contents_for(/obj/item/storage/backpack/holding)
|
||||
var/static/list/bag_cache = typecacheof(/obj/item/storage/backpack/holding)
|
||||
var/list/bagholding = typecache_filter_list(teleatom.GetAllContents(), bag_cache)
|
||||
if(bagholding.len)
|
||||
precision = max(rand(1,100)*bagholding.len,100)
|
||||
if(isliving(teleatom))
|
||||
var/mob/living/MM = teleatom
|
||||
to_chat(MM, "<span class='warning'>The bluespace interface on your bag of holding interferes with the teleport!</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
// Safe location finder
|
||||
|
||||
|
||||
@@ -244,32 +244,6 @@
|
||||
else if(src in container)
|
||||
return 1
|
||||
|
||||
/*
|
||||
* atom/proc/search_contents_for(path,list/filter_path=null)
|
||||
* Recursevly searches all atom contens (including contents contents and so on).
|
||||
*
|
||||
* ARGS: path - search atom contents for atoms of this type
|
||||
* list/filter_path - if set, contents of atoms not of types in this list are excluded from search.
|
||||
*
|
||||
* RETURNS: list of found atoms
|
||||
*/
|
||||
|
||||
/atom/proc/search_contents_for(path,list/filter_path=null)
|
||||
var/list/found = list()
|
||||
for(var/atom/A in src)
|
||||
if(istype(A, path))
|
||||
found += A
|
||||
if(filter_path)
|
||||
var/pass = 0
|
||||
for(var/type in filter_path)
|
||||
pass |= istype(A, type)
|
||||
if(!pass)
|
||||
continue
|
||||
if(A.contents.len)
|
||||
found += A.search_contents_for(path,filter_path)
|
||||
return found
|
||||
|
||||
|
||||
/atom/proc/examine(mob/user)
|
||||
//This reformat names to get a/an properly working on item descriptions when they are bloody
|
||||
var/f_name = "\a [src]."
|
||||
|
||||
@@ -91,9 +91,11 @@
|
||||
var/obj/item/device/nuclear_challenge/challenge = new /obj/item/device/nuclear_challenge
|
||||
synd_mind.current.put_in_hands(challenge, TRUE)
|
||||
|
||||
var/list/foundIDs = synd_mind.current.search_contents_for(/obj/item/card/id)
|
||||
var/static/id_cache = typecacheof(/obj/item/card/id)
|
||||
var/list/foundIDs = typecache_filter_list(synd_mind.current.GetAllContents(), id_cache)
|
||||
if(foundIDs.len)
|
||||
for(var/obj/item/card/id/ID in foundIDs)
|
||||
for(var/i in 1 to foundIDs.len)
|
||||
var/obj/item/card/id/ID = foundIDs[i]
|
||||
ID.name = "lead agent card"
|
||||
ID.access += ACCESS_SYNDICATE_LEADER
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user