mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #6690 from VOREStation/vplk-ntnet-fixer
Fixes to Modular Computers and NTNet Relays
This commit is contained in:
@@ -31,9 +31,10 @@ var/global/datum/ntnet/ntnet_global = new()
|
||||
/datum/ntnet/New()
|
||||
if(ntnet_global && (ntnet_global != src))
|
||||
ntnet_global = src // There can be only one.
|
||||
for(var/obj/machinery/ntnet_relay/R in machines)
|
||||
relays.Add(R)
|
||||
R.NTNet = src
|
||||
if (SSatoms && SSatoms.initialized > INITIALIZATION_INSSATOMS)
|
||||
for(var/obj/machinery/ntnet_relay/R in machines)
|
||||
relays.Add(R)
|
||||
R.NTNet = src
|
||||
build_software_lists()
|
||||
build_news_list()
|
||||
build_emails_list()
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
icon_state = "bus"
|
||||
anchored = 1
|
||||
density = 1
|
||||
circuit = /obj/item/weapon/circuitboard/ntnet_relay
|
||||
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
|
||||
var/enabled = 1 // Set to 0 if the relay was turned off
|
||||
var/dos_failure = 0 // Set to 1 if the relay failed due to (D)DoS attack
|
||||
@@ -93,17 +94,16 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/ntnet_relay/New()
|
||||
uid = gl_uid
|
||||
gl_uid++
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/stack/cable_coil(src,15)
|
||||
component_parts += new /obj/item/weapon/circuitboard/ntnet_relay(src)
|
||||
..()
|
||||
assign_uid()
|
||||
default_apply_parts()
|
||||
|
||||
/obj/machinery/ntnet_relay/Initialize()
|
||||
. = ..()
|
||||
if(ntnet_global)
|
||||
ntnet_global.relays.Add(src)
|
||||
NTNet = ntnet_global
|
||||
ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/Destroy()
|
||||
if(ntnet_global)
|
||||
@@ -113,24 +113,11 @@
|
||||
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
|
||||
D.target = null
|
||||
D.error = "Connection to quantum relay severed"
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/ntnet_relay/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if(default_deconstruction_screwdriver(user, W))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, W))
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(W.is_screwdriver())
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
panel_open = !panel_open
|
||||
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch")
|
||||
return
|
||||
if(W.is_crowbar())
|
||||
if(!panel_open)
|
||||
to_chat(user, "Open the maintenance panel first.")
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
to_chat(user, "You disassemble \the [src]!")
|
||||
|
||||
for(var/atom/movable/A in component_parts)
|
||||
A.forceMove(src.loc)
|
||||
new /obj/structure/frame(src.loc)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
Reference in New Issue
Block a user