From 4acf0f5dd8fa54f979a267ec2df50f46c105a3ca Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 21 May 2021 15:24:33 +0200 Subject: [PATCH] [MIRROR] Fixes bombproof containers not protecting their content in some cases (#5844) * added get content recursive flag check (#59191) * Fixes bombproof containers not protecting their content in some cases Co-authored-by: Mickyan <38563876+Mickyan@users.noreply.github.com> --- code/__HELPERS/unsorted.dm | 5 +++-- code/controllers/subsystem/explosions.dm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9bac53c0709..a0ffe79d509 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -427,12 +427,13 @@ Turf and target are separate in case you want to teleport some distance from a t ///Returns the src and all recursive contents as a list. -/atom/proc/GetAllContents() +/atom/proc/GetAllContents(ignore_flag_1) . = list(src) var/i = 0 while(i < length(.)) var/atom/A = .[++i] - . += A.contents + if (!(A.flags_1 & ignore_flag_1)) + . += A.contents ///identical to getallcontents but returns a list of atoms of the type passed in the argument. /atom/proc/get_all_contents_type(type) diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm index 3cf506a9a26..f10c3a0617c 100644 --- a/code/controllers/subsystem/explosions.dm +++ b/code/controllers/subsystem/explosions.dm @@ -354,7 +354,7 @@ SUBSYSTEM_DEF(explosions) for(var/I in T) var/atom/A = I if (length(A.contents) && !(A.flags_1 & PREVENT_CONTENTS_EXPLOSION_1)) //The atom/contents_explosion() proc returns null if the contents ex_acting has been handled by the atom, and TRUE if it hasn't. - items += A.GetAllContents() + items += A.GetAllContents(ignore_flag_1 = PREVENT_CONTENTS_EXPLOSION_1) for(var/thing in items) var/atom/movable/movable_thing = thing if(QDELETED(movable_thing))