mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var/global/static/ntnrc_uid = 0
|
||||
GLOBAL_VAR_INIT(ntnrc_uid, 0)
|
||||
|
||||
/datum/ntnet_conversation
|
||||
var/id = null
|
||||
@@ -9,15 +9,15 @@ var/global/static/ntnrc_uid = 0
|
||||
var/password
|
||||
|
||||
/datum/ntnet_conversation/New()
|
||||
id = ntnrc_uid
|
||||
ntnrc_uid++
|
||||
if(ntnet_global)
|
||||
ntnet_global.chat_channels.Add(src)
|
||||
id = GLOB.ntnrc_uid
|
||||
GLOB.ntnrc_uid++
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.chat_channels.Add(src)
|
||||
..()
|
||||
|
||||
/datum/ntnet_conversation/Destroy()
|
||||
if(ntnet_global)
|
||||
ntnet_global.chat_channels.Remove(src)
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.chat_channels.Remove(src)
|
||||
return ..()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_message(message, username)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/datum/ntnet/ntnet_global = new()
|
||||
GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new())
|
||||
|
||||
|
||||
// This is the NTNet datum. There can be only one NTNet datum in game at once. Modular computers read data from this.
|
||||
@@ -26,8 +26,8 @@ var/global/datum/ntnet/ntnet_global = new()
|
||||
|
||||
// If new NTNet datum is spawned, it replaces the old one.
|
||||
/datum/ntnet/New()
|
||||
if(ntnet_global && (ntnet_global != src))
|
||||
ntnet_global = src // There can be only one.
|
||||
if(GLOB.ntnet_global && (GLOB.ntnet_global != src))
|
||||
GLOB.ntnet_global = src // There can be only one.
|
||||
for(var/obj/machinery/ntnet_relay/R in GLOB.machines)
|
||||
relays.Add(R)
|
||||
R.NTNet = src
|
||||
|
||||
@@ -51,12 +51,12 @@
|
||||
if((dos_overload > dos_capacity) && !dos_failure)
|
||||
dos_failure = 1
|
||||
update_icon()
|
||||
ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
|
||||
GLOB.ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
|
||||
// If the DoS buffer reaches 0 again, restart.
|
||||
if((dos_overload == 0) && dos_failure)
|
||||
dos_failure = 0
|
||||
update_icon()
|
||||
ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
|
||||
GLOB.ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
@@ -82,10 +82,10 @@
|
||||
dos_overload = 0
|
||||
dos_failure = 0
|
||||
update_icon()
|
||||
ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
|
||||
GLOB.ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
|
||||
if("toggle")
|
||||
enabled = !enabled
|
||||
ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
|
||||
GLOB.ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
@@ -101,16 +101,16 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 2)
|
||||
component_parts += new /obj/item/stock_parts/subspace/filter(null)
|
||||
|
||||
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]")
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.relays.Add(src)
|
||||
NTNet = GLOB.ntnet_global
|
||||
GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/Destroy()
|
||||
if(ntnet_global)
|
||||
ntnet_global.relays.Remove(src)
|
||||
ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.relays.Remove(src)
|
||||
GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
|
||||
NTNet = null
|
||||
|
||||
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
|
||||
|
||||
Reference in New Issue
Block a user