From bc49cb69f81edba67605490275a07f2fcd5a6883 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 17 Oct 2022 11:01:44 +0200 Subject: [PATCH] [MIRROR] Gives pocket protectors their inventory back, also fixes an allowed contents display error [MDB IGNORE] (#16919) * Gives pocket protectors their inventory back, also fixes an allowed contents display error (#70528) * create_storage is now part of pocketprotector init, not just the full subtype of it. * set_holdable now takes atom_storage into account when setting what can be held in them. * Gives pocket protectors their inventory back, also fixes an allowed contents display error Co-authored-by: Rhials --- code/game/atoms.dm | 3 ++- code/modules/clothing/under/accessories.dm | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index fe975b6f7c3..28eddf8e884 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -374,7 +374,8 @@ atom_storage = new cloning.type(src, cloning.max_slots, cloning.max_specific_storage, cloning.max_total_storage, cloning.numerical_stacking, cloning.allow_quick_gather, cloning.collection_mode, cloning.attack_hand_interact) if(cloning.can_hold || cloning.cant_hold) - atom_storage.set_holdable(cloning.can_hold, cloning.cant_hold) + if(!atom_storage.can_hold && !atom_storage.cant_hold) //In the event that the can/can't hold lists are already in place (such as from storage objects added on initialize). + atom_storage.set_holdable(cloning.can_hold, cloning.cant_hold) return atom_storage diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm index 6c87c18c384..3f5dee43261 100644 --- a/code/modules/clothing/under/accessories.dm +++ b/code/modules/clothing/under/accessories.dm @@ -360,11 +360,14 @@ desc = "Can protect your clothing from ink stains, but you'll look like a nerd if you're using one." icon_state = "pocketprotector" -/obj/item/clothing/accessory/pocketprotector/full/Initialize(mapload) +/obj/item/clothing/accessory/pocketprotector/Initialize(mapload) . = ..() create_storage(type = /datum/storage/pockets/pocketprotector) +/obj/item/clothing/accessory/pocketprotector/full/Initialize(mapload) + . = ..() + new /obj/item/pen/red(src) new /obj/item/pen(src) new /obj/item/pen/blue(src)