Files
Cody Brittain 3f62424312 [MDB Ignore] [IDB Ignore] Kills off /obj/item/device (#21774)
This has zero reason to exist in our code base. We have no procs or
variables tied to this. I removed it to make future modifications
cleaner.

---------

Signed-off-by: Cody Brittain <1779662+Generalcamo@users.noreply.github.com>
2026-02-01 05:14:26 +00:00

56 lines
1.7 KiB
Plaintext

/obj/item/computer_hardware/card_slot
name = "RFID card slot"
desc = "Slot that allows this computer to write data on RFID cards. Necessary for some programs to run properly."
power_usage = 10 // W
critical = FALSE
icon_state = "cardreader"
hardware_size = 1
origin_tech = list(TECH_DATA = 2)
var/obj/item/card/id/stored_card
// Storing Items
var/list/allowed_items = list(
/obj/item/pen,
/obj/item/lipstick,
/obj/item/flashlight/pen,
/obj/item/clothing/mask/smokable/cigarette
)
var/obj/item/stored_item // Used for pen insertion and removal.
/obj/item/computer_hardware/card_slot/Destroy()
if(parent_computer?.card_slot == src)
parent_computer.card_slot = null
if(stored_card)
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 ..()
/obj/item/computer_hardware/card_slot/proc/insert_id(var/obj/item/card/id/id)
if(!istype(id))
return
id.forceMove(src)
stored_card = id
if(parent_computer)
parent_computer.verbs += /obj/item/modular_computer/proc/eject_id
parent_computer.initial_name = parent_computer.name
parent_computer.name = "[parent_computer.name] - [id.registered_name], [id.assignment]"
/obj/item/computer_hardware/card_slot/proc/eject_id(mob/user)
if(!stored_card)
return
if(ishuman(user))
user.put_in_hands(stored_card)
else
stored_card.forceMove(get_turf(src))
stored_card = null
if(parent_computer)
parent_computer.verbs -= /obj/item/modular_computer/proc/eject_id
parent_computer.name = parent_computer.initial_name