Modular computers QDEL and refdrops (#17655)

* Atomization

* sdfasdf

---------

Co-authored-by: FluffyGhost <FluffyGhost>
This commit is contained in:
Fluffy
2023-10-26 19:41:29 +02:00
committed by GitHub
parent af5828a42a
commit 736922d4cd
11 changed files with 139 additions and 13 deletions

View File

@@ -22,7 +22,10 @@
if(parent_computer?.card_slot == src)
parent_computer.card_slot = null
if(stored_card)
stored_card.forceMove(get_turf(parent_computer))
stored_card.forceMove(get_turf(parent_computer)) //Why the hell are we not QDEL'ing the stored card if we're being destroyed? I don't know, but something might rely on it, hence...
stored_card = null //the conservative approach is to just null the reference and hope for the best
QDEL_NULL(stored_item)
parent_computer = null
return ..()
@@ -49,4 +52,4 @@
if(parent_computer)
parent_computer.verbs -= /obj/item/modular_computer/proc/eject_id
parent_computer.name = parent_computer.initial_name
parent_computer.name = parent_computer.initial_name

View File

@@ -142,15 +142,21 @@
return null
if(!stored_files)
return null
for(var/datum/computer_file/F in stored_files)
if(QDELETED(F))
continue
if(F.filename == filename)
return F
return null
/obj/item/computer_hardware/hard_drive/Destroy()
if(parent_computer?.hard_drive == src)
parent_computer.hard_drive = null
stored_files = null
QDEL_NULL_LIST(stored_files)
return ..()
/obj/item/computer_hardware/hard_drive/Initialize(mapload)