From 1d32faf3e30d32c15ace2c8a0dfbe61b83229b86 Mon Sep 17 00:00:00 2001 From: Adrer Date: Fri, 20 Sep 2024 23:08:26 +0200 Subject: [PATCH] [FIX] Now properly remove/add machines to the RNC console when (un)linked (#26815) * Now properly remove/add machines to the rdconsole when (un)linked * Remove unused variable --------- Co-authored-by: Adrer --- code/game/mecha/mech_fabricator.dm | 3 +++ code/modules/research/rdconsole.dm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index fa746b28fe8..c64cfd40f11 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -454,6 +454,7 @@ var/user_pass = tgui_input_text(usr, "Please enter network password", "Password Entry") // Check the password if(user_pass == C.network_password) + C.mechfabs += UID() network_manager_uid = C.UID() to_chat(usr, "Successfully linked to [C.network_name].") else @@ -536,6 +537,8 @@ add_fingerprint(usr) /obj/machinery/mecha_part_fabricator/proc/unlink() + var/obj/machinery/computer/rnd_network_controller/RNC = locateUID(network_manager_uid) + RNC.mechfabs -= UID() network_manager_uid = null SStgui.update_uis(src) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 5ebab391faf..216f680e855 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -478,6 +478,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/user_pass = input(usr, "Please enter network password", "Password Entry") // Check the password if(user_pass == C.network_password) + C.consoles += UID() network_manager_uid = C.UID() to_chat(usr, "Successfully linked to [C.network_name].") else @@ -708,6 +709,8 @@ won't update every console in existence) but it's more of a hassle to do. Also, return TRUE // update uis /obj/machinery/computer/rdconsole/proc/unlink() + var/obj/machinery/computer/rnd_network_controller/RNC = locateUID(network_manager_uid) + RNC.consoles -= UID() network_manager_uid = null SStgui.update_uis(src)