Skip to content

Commit

Permalink
[FIX] Now properly remove/add machines to the RNC console when (un)li…
Browse files Browse the repository at this point in the history
…nked (#26815)

* Now properly remove/add machines to the rdconsole when (un)linked

* Remove unused variable

---------

Co-authored-by: Adrer <adrermail@gmail.com>
  • Loading branch information
Adrer and Adrer committed Sep 20, 2024
1 parent 7262bfb commit 1d32faf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='notice'>Successfully linked to <b>[C.network_name]</b>.</span>")
else
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/research/rdconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='notice'>Successfully linked to <b>[C.network_name]</b>.</span>")
else
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 1d32faf

Please sign in to comment.