[MIRROR] [READY]Circuit balance (#5760)
* [READY]Circuit balance * [READY]Circuit balance (#35931) * cooldowns, power cell,disks * NUMBERS NUMBERS NUMBERS * 1 8 9 * PR PR PR * DESC DESCDSCDCC * <br> * GET ALL CONTENTS * Update power.dm * Update power.dm * Update time.dm
This commit is contained in:
committed by
Poojawa
parent
7d9dbcd0c3
commit
59d61d5e0d
@@ -518,16 +518,24 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
Gets all contents of contents and returns them all in a list.
|
||||
*/
|
||||
|
||||
/atom/proc/GetAllContents()
|
||||
/atom/proc/GetAllContents(var/T)
|
||||
var/list/processing_list = list(src)
|
||||
var/list/assembled = list()
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
processing_list.Cut(1, 2)
|
||||
//Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed
|
||||
//This is also why we don't need to check against assembled as we go along
|
||||
processing_list += A.contents
|
||||
assembled += A
|
||||
if(T)
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
processing_list.Cut(1, 2)
|
||||
//Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed
|
||||
//This is also why we don't need to check against assembled as we go along
|
||||
processing_list += A.contents
|
||||
if(istype(A,T))
|
||||
assembled += A
|
||||
else
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
processing_list.Cut(1, 2)
|
||||
processing_list += A.contents
|
||||
assembled += A
|
||||
return assembled
|
||||
|
||||
/atom/proc/GetAllContentsIgnoring(list/ignore_typecache)
|
||||
|
||||
Reference in New Issue
Block a user