From cfe2aacab00c82cf05b60844041812bfd2cf869e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 15 Sep 2022 05:42:18 +0200 Subject: [PATCH] [MIRROR] Fixes a closet harddel [MDB IGNORE] (#16235) * Fixes a closet harddel (#69889) * Fixes a closet harddel PopulateContents is called in init which means that the closet is being qdelled but it's contents are not being properly removed when the prob(1) is called and it returns the qdel hint. This returns the qdel hint BEFORE parents init is called to stop this from happening * okay im just stupid * moves it * Update code/modules/unit_tests/closets.dm Co-authored-by: ShizCalev * Update code/modules/unit_tests/closets.dm Co-authored-by: ShizCalev * Fixes a closet harddel Co-authored-by: Seth Scherer Co-authored-by: ShizCalev --- code/modules/unit_tests/closets.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/unit_tests/closets.dm b/code/modules/unit_tests/closets.dm index b7f0d5e94c4..8145e2a0a9b 100644 --- a/code/modules/unit_tests/closets.dm +++ b/code/modules/unit_tests/closets.dm @@ -9,10 +9,11 @@ for(var/closet_type in all_closets) var/obj/structure/closet/closet = allocate(closet_type) + if(istype(closet_type, /obj/structure/closet/emcloset) && QDELETED(closet)) // this is here because the emcloset subtype has a chance of returning a qdel hint on initialize + continue // Copy is necessary otherwise closet.contents - immediate_contents returns an empty list var/list/immediate_contents = closet.contents.Copy() - closet.PopulateContents() var/contents_len = length(closet.contents)