<commit_before>
// External storage-related logic:
// /mob/proc/ClickOn() in /_onclick/click.dm - clicking items in storages
// /mob/living/Move() in /modules/mob/living/living.dm - hiding storage boxes on mob movement

/datum/component/storage/concrete
	var/drop_all_on_deconstruct = TRUE
	var/drop_all_on_destroy = FALSE
	var/transfer_contents_on_component_transfer = FALSE
	var/list/datum/component/storage/slaves = list()

	var/list/_contents_limbo // Where objects go to live mid transfer
	var/list/_user_limbo // The last users before the component started moving

/datum/component/storage/concrete/Initialize()
	. = ..()
	RegisterSignal(COMSIG_ATOM_CONTENTS_DEL, .proc/on_contents_del)
	RegisterSignal(COMSIG_OBJ_DECONSTRUCT, .proc/on_deconstruct)

/datum/component/storage/concrete/Destroy()
	var/atom/real_location = real_location()
	for(var/atom/_A in real_location)
		_A.mouse_opacity = initial(_A.mouse_opacity)
	if(drop_all_on_destroy)
		do_quick_empty()
	for(var/i in slaves)
		var/datum/component/storage/slave = i
		slave.change_master(null)
	return ..()

/datum/component/storage/concrete/master()
	return src

/datum/component/storage/concrete/real_location()
	return parent

/datum/component/storage/concrete/PreTransfer()
	if(is_using)
		_user_limbo = is_using.Copy()
		close_all()
	if(transfer_contents_on_component_transfer)
		_contents_limbo = list()
		for(var/atom/movable/AM in parent)<commit_msg>Purge references in /storage/concrete Destroy<commit_after>
// External storage-related logic:
// /mob/proc/ClickOn() in /_onclick/click.dm - clicking items in storages
// /mob/living/Move() in /modules/mob/living/living.dm - hiding storage boxes on mob movement

/datum/component/storage/concrete
	var/drop_all_on_deconstruct = TRUE
	var/drop_all_on_destroy = FALSE
	var/transfer_contents_on_component_transfer = FALSE
	var/list/datum/component/storage/slaves = list()

	var/list/_contents_limbo // Where objects go to live mid transfer
	var/list/_user_limbo // The last users before the component started moving

/datum/component/storage/concrete/Initialize()
	. = ..()
	RegisterSignal(COMSIG_ATOM_CONTENTS_DEL, .proc/on_contents_del)
	RegisterSignal(COMSIG_OBJ_DECONSTRUCT, .proc/on_deconstruct)

/datum/component/storage/concrete/Destroy()
	var/atom/real_location = real_location()
	for(var/atom/_A in real_location)
		_A.mouse_opacity = initial(_A.mouse_opacity)
	if(drop_all_on_destroy)
		do_quick_empty()
	for(var/i in slaves)
		var/datum/component/storage/slave = i
		slave.change_master(null)
	if(_contents_limbo)
		for(var/i in _contents_limbo)
			qdel(i)
	_user_limbo = null
	return ..()

/datum/component/storage/concrete/master()
	return src

/datum/component/storage/concrete/real_location()
	return parent

/datum/component/storage/concrete/PreTransfer()
	if(is_using)
		_user_limbo = is_using.Copy()
		close_all()
	if(transfer_contents_on_component_transfer)
		_contents_limbo = list()
		for(var/atom/movable/AM in parent)
{'fraction_non_alphanumeric': 0.11081081081081082, 'fraction_numerical': 0.0, 'mean_word_length': 4.933867735470942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3828774', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1026, 'n_words': 180}