[NO GBP] Fixes sswardrobe not deleting modsuit parts after failing to stash them (#93901)

## About The Pull Request

Should fix https://github.com/tgstation/tgstation/issues/93897

This implements a restock blacklist for SSwardrobe. If an item type is
in the blacklist, then SSwardrobe will never try to restock that item,
instead just deleting them.

## Why It's Good For The Game

Fixes ever-expanding pile of modsuits in nullspace, and lets modsuits
actually be wardrobed properly

## Changelog

🆑
fix: fixes an where modsuits would accumulate in nullspace over the
course of a round
/🆑
This commit is contained in:
Bloop
2025-11-18 22:52:07 -05:00
committed by GitHub
parent 6a82647fee
commit 8b66328e4d
4 changed files with 15 additions and 9 deletions
+12 -2
View File
@@ -41,6 +41,10 @@ SUBSYSTEM_DEF(wardrobe)
var/stock_hit = 0
/// How many items would we make just by loading the master list once?
var/one_go_master = 0
/// Item types that should not ever be recycled, only generated (like modsuits)
var/static/list/recycle_blacklist = typecacheof(list(
/obj/item/mod/control/pre_equipped,
))
/datum/controller/subsystem/wardrobe/Initialize()
setup_callbacks()
@@ -207,11 +211,17 @@ SUBSYSTEM_DEF(wardrobe)
order_list[queued_type] = amount
/// Take an existing object, and recycle it if we are allowed to by stashing it back into our storage
/datum/controller/subsystem/wardrobe/proc/recycle_object(obj/item/object)
// Don't restock blacklisted items, instead just delete them
if(is_type_in_typecache(object, recycle_blacklist))
qdel(object)
return
stash_object(object)
/// Take an existing object, and insert it into our storage
/// If we can't or won't take it, it's deleted. You do not own this object after passing it in
/datum/controller/subsystem/wardrobe/proc/stash_object(obj/item/object)
if(object.item_flags & DO_NOT_WARDROBE)
return
var/object_type = object.type
var/list/master_info = canon_minimum[object_type]
// I will not permit objects you didn't reserve ahead of time