mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
Fixes ID cards being left behind by the residential lifts (#22162)
Adds a new var to the uninstall component that defaults to true. We only disable it if we're trying to delete the id card too, such as by the deleting the pda in the residential lift.
This commit is contained in:
@@ -116,7 +116,8 @@
|
||||
QDEL_LIST(hard_drive.stored_files)
|
||||
|
||||
for(var/obj/item/computer_hardware/CH in src.get_all_components())
|
||||
uninstall_component(null, CH)
|
||||
// Eject_id is made false here as we want to delete the id too
|
||||
uninstall_component(null, CH, eject_id = FALSE)
|
||||
qdel(CH)
|
||||
|
||||
registered_id = null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Attempts to install the hardware into appropriate slot.
|
||||
/// Attempts to install the hardware into appropriate slot.
|
||||
/obj/item/modular_computer/proc/try_install_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = FALSE)
|
||||
// "USB" flash drive.
|
||||
if(istype(H, /obj/item/computer_hardware/hard_drive/portable))
|
||||
@@ -96,8 +96,9 @@
|
||||
user.drop_from_inventory(H, src)
|
||||
update_icon()
|
||||
|
||||
// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware.
|
||||
/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = FALSE, var/critical = FALSE, var/put_in_hands = FALSE)
|
||||
/// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware.
|
||||
/// Eject_id should only ever be made false if we're trying to delete the whole thing, such as when using cryo to leave the round.
|
||||
/obj/item/modular_computer/proc/uninstall_component(mob/living/user, obj/item/computer_hardware/H, found = FALSE, critical = FALSE, put_in_hands = FALSE, eject_id = TRUE)
|
||||
if(portable_drive == H)
|
||||
portable_drive = null
|
||||
found = TRUE
|
||||
@@ -112,7 +113,8 @@
|
||||
nano_printer = null
|
||||
found = TRUE
|
||||
else if(card_slot == H)
|
||||
astype(H, /obj/item/computer_hardware/card_slot)?.eject_id()
|
||||
if(eject_id)
|
||||
astype(H, /obj/item/computer_hardware/card_slot)?.eject_id()
|
||||
card_slot = null
|
||||
found = TRUE
|
||||
else if(battery_module == H)
|
||||
@@ -160,7 +162,7 @@
|
||||
to_chat(user, SPAN_WARNING("\The [src]'s screen freezes for few seconds and then displays, \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\"."))
|
||||
shutdown_computer()
|
||||
|
||||
// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
|
||||
/// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
|
||||
/obj/item/modular_computer/proc/find_hardware_by_name(var/name)
|
||||
if(portable_drive && (initial(portable_drive.name) == name))
|
||||
return portable_drive
|
||||
@@ -190,7 +192,7 @@
|
||||
return access_cable_dongle
|
||||
return null
|
||||
|
||||
// Returns list of all components
|
||||
/// Returns list of all components
|
||||
/obj/item/modular_computer/proc/get_all_components()
|
||||
var/list/all_components = list()
|
||||
if(hard_drive)
|
||||
|
||||
Reference in New Issue
Block a user