Locking a storage item now locks you out of other storage items inside it. (#90243)

## About The Pull Request
This PR introduces the `set_locked()` proc, which I'll also need for
something else later.

## Why It's Good For The Game
I could still interact with the storage of a box I placed into a secure
safe after I locked the latter.

## Changelog

🆑
fix: Locking a storage item now locks you out of other storage items
inside it.
/🆑
This commit is contained in:
Ghom
2025-04-29 17:41:26 -06:00
committed by Shadow-Quill
parent 3cbce355b9
commit b61ed0972e
9 changed files with 33 additions and 37 deletions
+3 -3
View File
@@ -22,19 +22,19 @@
. = ..()
create_storage(max_specific_storage = max_w_class, max_total_storage = max_combined_w_class, max_slots = max_items)
atom_storage.allow_big_nesting = TRUE
atom_storage.locked = STORAGE_FULLY_LOCKED
atom_storage.set_locked(STORAGE_FULLY_LOCKED)
/obj/item/mod/module/storage/on_install()
var/datum/storage/modstorage = mod.create_storage(max_specific_storage = max_w_class, max_total_storage = max_combined_w_class, max_slots = max_items)
modstorage.set_real_location(src)
modstorage.allow_big_nesting = big_nesting
atom_storage.locked = STORAGE_NOT_LOCKED
atom_storage.set_locked(STORAGE_NOT_LOCKED)
var/obj/item/clothing/suit = mod.get_part_from_slot(ITEM_SLOT_OCLOTHING)
if(istype(suit))
RegisterSignal(suit, COMSIG_ITEM_PRE_UNEQUIP, PROC_REF(on_suit_unequip))
/obj/item/mod/module/storage/on_uninstall(deleting = FALSE)
atom_storage.locked = STORAGE_FULLY_LOCKED
atom_storage.set_locked(STORAGE_FULLY_LOCKED)
QDEL_NULL(mod.atom_storage)
if(!deleting)
atom_storage.remove_all(mod.drop_location())