[MIRROR] Fixes a bunch of harddels that are sourced from player action (#6252)

* Fixes a bunch of harddels that are sourced from player action

* Mirror!

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
This commit is contained in:
SkyratBot
2021-06-11 04:13:33 +02:00
committed by GitHub
parent cc5595fddf
commit 6f3b151bb8
165 changed files with 1076 additions and 546 deletions
@@ -29,6 +29,8 @@
/datum/ntnet_conversation/Destroy()
if(SSnetworks.station_network)
SSnetworks.station_network.chat_channels.Remove(src)
for(var/datum/computer_file/program/chatclient/chatterbox in (active_clients | offline_clients | muted_clients))
purge_client(chatterbox)
return ..()
/datum/ntnet_conversation/proc/add_message(message, username)
@@ -48,6 +50,7 @@
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/new_user, silent = FALSE)
if(!istype(new_user))
return
new_user.conversations |= src
active_clients.Add(new_user)
if(!silent)
add_status_message("[new_user.username] has joined the channel.")
@@ -55,11 +58,19 @@
if(!operator)
changeop(new_user)
//Clear all of our references to a client, used for client deletion
/datum/ntnet_conversation/proc/purge_client(datum/computer_file/program/chatclient/forget)
remove_client(forget)
muted_clients -= forget
offline_clients -= forget
forget.conversations -= src
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/leaving)
if(!istype(leaving) || !(leaving in active_clients))
if(!istype(leaving))
return
active_clients.Remove(leaving)
add_status_message("[leaving.username] has left the channel.")
if(leaving in active_clients)
active_clients.Remove(leaving)
add_status_message("[leaving.username] has left the channel.")
// Channel operator left, pick new operator
if(leaving == operator)
@@ -26,8 +26,6 @@
/obj/machinery/modular_computer/console/preset/proc/install_programs()
return
// ===== ENGINEERING CONSOLE =====
/obj/machinery/modular_computer/console/preset/engineering
console_department = "Engineering"
@@ -19,10 +19,18 @@
var/list/channel_history = list()
var/operator_mode = FALSE // Channel operator mode
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
//A list of all the converstations we're a part of
var/list/datum/ntnet_conversation/conversations = list()
/datum/computer_file/program/chatclient/New()
username = "DefaultUser[rand(100, 999)]"
/datum/computer_file/program/chatclient/Destroy()
for(var/datum/ntnet_conversation/discussion as anything in conversations)
discussion.purge_client(src)
conversations.Cut()
return ..()
/datum/computer_file/program/chatclient/ui_act(action, params)
. = ..()
if(.)
@@ -37,11 +37,15 @@
refresh()
/datum/computer_file/program/supermatter_monitor/kill_program(forced = FALSE)
for(var/supermatter in supermatters)
clear_supermatter(supermatter)
supermatters = null
..()
// Refreshes list of active supermatter crystals
/datum/computer_file/program/supermatter_monitor/proc/refresh()
for(var/supermatter in supermatters)
clear_supermatter(supermatter)
supermatters = list()
var/turf/T = get_turf(ui_host())
if(!T)
@@ -51,9 +55,7 @@
if (!isturf(S.loc) || !(is_station_level(S.z) || is_mining_level(S.z) || S.z == T.z))
continue
supermatters.Add(S)
if(!(active in supermatters))
active = null
RegisterSignal(S, COMSIG_PARENT_QDELETING, .proc/react_to_del)
/datum/computer_file/program/supermatter_monitor/proc/get_status()
. = SUPERMATTER_INACTIVE
@@ -167,3 +169,13 @@
active = S
set_signals()
return TRUE
/datum/computer_file/program/supermatter_monitor/proc/react_to_del(datum/source)
SIGNAL_HANDLER
clear_supermatter(source)
/datum/computer_file/program/supermatter_monitor/proc/clear_supermatter(matter)
supermatters -= matter
if(matter == active)
active = null
UnregisterSignal(matter, COMSIG_PARENT_QDELETING)
@@ -117,7 +117,7 @@
return null
/obj/item/computer_hardware/hard_drive/Destroy()
stored_files = null
QDEL_LIST(stored_files)
return ..()
/obj/item/computer_hardware/hard_drive/Initialize()