mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Cleanup.
This commit is contained in:
@@ -33,9 +33,8 @@ var/datum/antagonist/ert/ert
|
||||
player.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses)
|
||||
|
||||
var/obj/item/weapon/card/id/centcom/ERT/W = new(src)
|
||||
W.registered_name = real_name
|
||||
W.name = "[real_name]'s ID Card ([W.assignment])"
|
||||
equip_to_slot_or_del(W, slot_wear_id)
|
||||
W.registered_name = player.real_name
|
||||
W.name = "[player.real_name]'s ID Card ([W.assignment])"
|
||||
player.equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -35,9 +35,6 @@
|
||||
|
||||
R.notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, R.module.name)
|
||||
R.module.Reset(R)
|
||||
qdel(R.module)
|
||||
R.module = null
|
||||
|
||||
R.updatename("Default")
|
||||
|
||||
return 1
|
||||
|
||||
@@ -36,27 +36,31 @@ var/global/list/robot_modules = list(
|
||||
// Bookkeeping
|
||||
var/list/added_languages = list()
|
||||
var/list/added_networks = list()
|
||||
var/obj/item/device/radio/borg/modified_radio = null
|
||||
var/list/modified_key = null
|
||||
var/list/original_radio_channels = list()
|
||||
|
||||
/obj/item/weapon/robot_module/New(var/mob/living/silicon/robot/R)
|
||||
..()
|
||||
add_camera_networks(R)
|
||||
add_languages(R)
|
||||
add_radio_channels(R)
|
||||
add_subsystems(R)
|
||||
apply_status_flags(R)
|
||||
|
||||
if(R.radio)
|
||||
R.radio.recalculateChannels()
|
||||
|
||||
/obj/item/weapon/robot_module/proc/Reset(var/mob/living/silicon/robot/R)
|
||||
..()
|
||||
R.module = null
|
||||
|
||||
remove_camera_networks(R)
|
||||
remove_languages(R)
|
||||
remove_radio_channels(R)
|
||||
remove_subsystems(R)
|
||||
remove_status_flags(R)
|
||||
|
||||
/obj/item/weapon/robot_module/Destroy()
|
||||
if(R.radio)
|
||||
R.radio.recalculateChannels()
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/robot_module/Destroy()
|
||||
qdel(modules)
|
||||
qdel(synths)
|
||||
qdel(emag)
|
||||
@@ -115,23 +119,6 @@ var/global/list/robot_modules = list(
|
||||
R.camera.remove_networks(added_networks)
|
||||
added_networks.Cut()
|
||||
|
||||
/obj/item/weapon/robot_module/proc/add_radio_channels(var/mob/living/silicon/robot/R)
|
||||
if(!R.radio)
|
||||
return
|
||||
|
||||
modified_radio = R.radio
|
||||
modified_key = R.radio.keyslot
|
||||
original_radio_channels = modified_radio.channels.Copy()
|
||||
modified_radio.config(channels)
|
||||
|
||||
/obj/item/weapon/robot_module/proc/remove_radio_channels(var/mob/living/silicon/robot/R)
|
||||
// Only reset if the original radio component hasn't been altered/replaced
|
||||
if(!(R.radio && R.radio == modified_radio && R.radio.keyslot == modified_key))
|
||||
return
|
||||
|
||||
modified_radio.config(original_radio_channels)
|
||||
original_radio_channels.Cut()
|
||||
|
||||
/obj/item/weapon/robot_module/proc/add_subsystems(var/mob/living/silicon/robot/R)
|
||||
R.verbs |= subsystems
|
||||
|
||||
|
||||
Reference in New Issue
Block a user