diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index fc694b3bc2b..9896baed557 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -73,10 +73,11 @@ if(content_size > storage_capacity-5) storage_capacity = content_size + 5 -/obj/structure/closet/Initialize(mapload) +/obj/structure/closet/Initialize(mapload, var/no_fill) . = ..() update_icon() - fill() + if(!no_fill) + fill() if(secure) verbs += /obj/structure/closet/proc/verb_togglelock return mapload ? INITIALIZE_HINT_LATELOAD : INITIALIZE_HINT_NORMAL diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 8337019e694..72112fa3ceb 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -539,20 +539,24 @@ "3" = (100 - ((STOCK_RARE_PROB * rarity) + (STOCK_UNCOMMON_PROB * rarity))) ) - var/list/valid_loot = typesof(/obj/structure/closet/crate) - typesof(/obj/structure/closet/crate/secure/gear_loadout) - valid_loot -= typesof(/obj/structure/closet/crate/loot) - var/icontype = pick(valid_loot) - var/obj/structure/closet/crate/C = new icontype(get_turf(src)) + var/list/crates_to_use = typesof(/obj/structure/closet/crate) - typesof(/obj/structure/closet/crate/secure/gear_loadout) + var/icontype = pick(crates_to_use) + var/obj/structure/closet/crate/C = new icontype(get_turf(src), TRUE) //TRUE as we do not want the crate to fill(), we will fill it ourselves. C.name = "unusual container" C.desc = "A mysterious container of unknown origins. What mysteries lie within?" - if(C.secure) - C.secure = FALSE - C.update_icon() + for(var/i in 1 to quantity) var/newtype = get_spawntype() call(newtype)(C) + if(C.secure || C.locked) //These should always be accessible + C.secure = FALSE + C.locked = FALSE + C.secure_lights = FALSE + C.req_access = null + C.update_icon() + qdel(src) /obj/structure/closet/crate/loot/proc/get_spawntype() diff --git a/html/changelogs/doxxmedearly-cratesbugfix.yml b/html/changelogs/doxxmedearly-cratesbugfix.yml new file mode 100644 index 00000000000..cc461d33956 --- /dev/null +++ b/html/changelogs/doxxmedearly-cratesbugfix.yml @@ -0,0 +1,5 @@ +author: Doxxmedearly +delete-after: True +changes: + - bugfix: "Unusual containers should no longer spawn locked." + - bugfix: "Unusual containers with certain appearances should no longer spawn with excess gear."