[MIRROR] Checks if a machine has no research before connecting techweb [MDB IGNORE] (#19032)

Checks if a machine has no research before connecting techweb (#72944)

## About The Pull Request

Currently all machines, if the config to not have a techweb link is on,
will set their node to science even if they were meant to be connected
to another (like through subtypes). This fixes that by checking to
ensure they don't have a techweb connected already before giving them a
new one.

Also as a minor fix, RD consoles will now properly add themselves to the
list of accessing RD consoles if they aren't linking to the default.
This list currently does nothing but I can see good uses of it in the
future.

## Why It's Good For The Game

Fixes an error that was found on a downstream, it's a worthwhile fix
that thankfully was caught this early.

## Changelog

Nothing player-facing.

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-01-31 02:07:05 +00:00
committed by GitHub
co-authored by John Willard
parent c0a97a668e
commit 3ec8063b1e
10 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -237,7 +237,7 @@
// Link machine with research techweb. Used for discovering and accessing
// already discovered mutations
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
stored_research = SSresearch.science_tech
/obj/machinery/computer/scan_consolenew/ui_interact(mob/user, datum/tgui/ui)
@@ -16,8 +16,8 @@
var/datum/component/experiment_handler/experiment_handler
/obj/machinery/computer/operating/Initialize(mapload)
..()
if(!CONFIG_GET(flag/no_default_techweb_link))
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb)
linked_techweb = SSresearch.science_tech
find_table()
return INITIALIZE_HINT_LATELOAD
@@ -137,7 +137,7 @@
skin = new_skin
update_appearance()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb)
linked_techweb = SSresearch.science_tech
AddComponent(/datum/component/tippable, \
@@ -24,7 +24,7 @@
/datum/computer_file/program/scipaper_program/on_start(mob/living/user)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb)
linked_techweb = SSresearch.science_tech
/datum/computer_file/program/scipaper_program/application_attackby(obj/item/attacking_item, mob/living/user)
@@ -23,7 +23,7 @@
/datum/computer_file/program/science/on_start(mob/living/user)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
stored_research = SSresearch.science_tech
/datum/computer_file/program/science/application_attackby(obj/item/attacking_item, mob/living/user)
+2 -1
View File
@@ -47,8 +47,9 @@ Nothing else in the console has ID requirements.
/obj/machinery/computer/rdconsole/Initialize(mapload)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
stored_research = SSresearch.science_tech
if(stored_research)
stored_research.consoles_accessing += src
/obj/machinery/computer/rdconsole/Destroy()
+1 -1
View File
@@ -20,7 +20,7 @@
/obj/machinery/rnd/Initialize(mapload)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
connect_techweb(SSresearch.science_tech)
wires = new /datum/wires/rnd(src)
+2 -2
View File
@@ -27,7 +27,7 @@
/obj/machinery/rnd/server/Initialize(mapload)
. = ..()
if(CONFIG_GET(flag/no_default_techweb_link))
if(CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
stored_research = new /datum/techweb
stored_research.techweb_servers |= src
name += " [num2hex(rand(1,65535), -1)]" //gives us a random four-digit hex number as part of the name. Y'know, for fluff.
@@ -119,7 +119,7 @@
/obj/machinery/computer/rdservercontrol/Initialize(mapload, obj/item/circuitboard/C)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
stored_research = SSresearch.science_tech
/obj/machinery/computer/rdservercontrol/Topic(href, href_list)
@@ -53,7 +53,7 @@
var/list/datum/design/cached_designs
/obj/machinery/mecha_part_fabricator/Initialize(mapload)
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
connect_techweb(SSresearch.science_tech)
rmat = AddComponent(/datum/component/remote_materials, "mechfab", mapload && link_on_init, mat_container_flags=BREAKDOWN_FLAGS_LATHE)
cached_designs = list()
@@ -19,7 +19,7 @@
/obj/machinery/component_printer/Initialize(mapload)
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link))
if(!CONFIG_GET(flag/no_default_techweb_link) && !techweb)
connect_techweb(SSresearch.science_tech)
materials = AddComponent( \