mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
[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:
@@ -44,7 +44,6 @@
|
||||
#define NO_MAT_REDEMPTION (1<<5) // Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
|
||||
#define DROPDEL (1<<6) // When dropped, it calls qdel on itself
|
||||
#define NOBLUDGEON (1<<7) // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
|
||||
#define DO_NOT_WARDROBE (1<<8) // Used to denote anything that should not be stashed by SSwardrobe
|
||||
/**
|
||||
* for all things that are technically items but don't want to be treated as such, given on a case-by-case basis
|
||||
* examples of use are hand items, omni-toolsets, non-limb limbs (hand eater, mounted chainsaw, many null rods), borg modules, bodyparts, organs, etc.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,14 +33,14 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
|
||||
var/obj/item/organ/current_organ = get_organ_slot(slot) //Time to cache it lads
|
||||
if(current_organ)
|
||||
current_organ.Remove(src, special = TRUE) //Please don't somehow kill our dummy
|
||||
SSwardrobe.stash_object(current_organ)
|
||||
SSwardrobe.recycle_object(current_organ)
|
||||
|
||||
var/datum/species/current_species = dna.species
|
||||
for(var/organ_path in current_species.mutant_organs)
|
||||
var/obj/item/organ/current_organ = get_organ_by_type(organ_path)
|
||||
if(current_organ)
|
||||
current_organ.Remove(src, special = TRUE) //Please don't somehow kill our dummy
|
||||
SSwardrobe.stash_object(current_organ)
|
||||
SSwardrobe.recycle_object(current_organ)
|
||||
|
||||
//Instead of just deleting our equipment, we save what we can and reinsert it into SSwardrobe's store
|
||||
//Hopefully this makes preference reloading not the worst thing ever
|
||||
@@ -55,8 +55,6 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
|
||||
if(!isitem(checking)) //What the fuck are you on
|
||||
to_nuke += checking
|
||||
continue
|
||||
if(checking.item_flags & DO_NOT_WARDROBE) // Skip any items like MOD parts, which are created in the contents of a stashed item and should not be destroyed
|
||||
continue
|
||||
|
||||
var/list/contents = checking.contents
|
||||
if(length(contents))
|
||||
@@ -68,7 +66,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
|
||||
if(ismob(checking.loc))
|
||||
var/mob/checkings_owner = checking.loc
|
||||
checkings_owner.temporarilyRemoveItemFromInventory(checking, TRUE) //Clear out of there yeah?
|
||||
SSwardrobe.stash_object(checking)
|
||||
SSwardrobe.recycle_object(checking)
|
||||
|
||||
for(var/obj/item/delete as anything in to_nuke)
|
||||
qdel(delete)
|
||||
|
||||
@@ -126,7 +126,6 @@
|
||||
part.set_armor(armor_type)
|
||||
part.resistance_flags = resistance_flags
|
||||
part.flags_1 |= atom_flags //flags like initialization or admin spawning are here, so we cant set, have to add
|
||||
part.item_flags |= DO_NOT_WARDROBE
|
||||
part.heat_protection = NONE
|
||||
part.cold_protection = NONE
|
||||
part.max_heat_protection_temperature = max_heat_protection_temperature
|
||||
|
||||
Reference in New Issue
Block a user