mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
06f0821bcf
commit
f7219329ca
@@ -30,7 +30,7 @@ The receiving atom will receive the origin atom (the atom that sent the message)
|
||||
It's suggested to start with an if or switch statement for the message, to determine what to do.
|
||||
*/
|
||||
|
||||
var/global/list/all_exonet_connections = list()
|
||||
GLOBAL_LIST_EMPTY(all_exonet_connections)
|
||||
|
||||
/datum/exonet_protocol
|
||||
var/address = "" //Resembles IPv6, but with only five 'groups', e.g. XXXX:XXXX:XXXX:XXXX:XXXX
|
||||
@@ -60,7 +60,7 @@ var/global/list/all_exonet_connections = list()
|
||||
new_address = "[addr_0]:[addr_1]"
|
||||
string = "[string]0" //If we did get a collision, this should make the next attempt not have one.
|
||||
address = new_address
|
||||
all_exonet_connections |= src
|
||||
GLOB.all_exonet_connections |= src
|
||||
|
||||
|
||||
// Proc: make_arbitrary_address()
|
||||
@@ -71,7 +71,7 @@ var/global/list/all_exonet_connections = list()
|
||||
if(new_address == find_address(new_address) ) //Collision test.
|
||||
return 0
|
||||
address = new_address
|
||||
all_exonet_connections |= src
|
||||
GLOB.all_exonet_connections |= src
|
||||
return 1
|
||||
|
||||
// Proc: hexadecimal_to_EPv2()
|
||||
@@ -93,14 +93,14 @@ var/global/list/all_exonet_connections = list()
|
||||
// Description: Deallocates the address, freeing it for use.
|
||||
/datum/exonet_protocol/proc/remove_address()
|
||||
address = ""
|
||||
all_exonet_connections.Remove(src)
|
||||
GLOB.all_exonet_connections.Remove(src)
|
||||
|
||||
|
||||
// Proc: find_address()
|
||||
// Parameters: 1 (target_address - the desired address to find)
|
||||
// Description: Searches the global list all_exonet_connections for a specific address, and returns it if found, otherwise returns null.
|
||||
/datum/exonet_protocol/proc/find_address(var/target_address)
|
||||
for(var/datum/exonet_protocol/exonet in all_exonet_connections)
|
||||
for(var/datum/exonet_protocol/exonet in GLOB.all_exonet_connections)
|
||||
if(exonet.address == target_address)
|
||||
return exonet.address
|
||||
return null
|
||||
@@ -109,7 +109,7 @@ var/global/list/all_exonet_connections = list()
|
||||
// Parameters: 1 (target_address - the desired address to find)
|
||||
// Description: Searches an address for the atom it is attached for, otherwise returns null.
|
||||
/datum/exonet_protocol/proc/get_atom_from_address(var/target_address)
|
||||
for(var/datum/exonet_protocol/exonet in all_exonet_connections)
|
||||
for(var/datum/exonet_protocol/exonet in GLOB.all_exonet_connections)
|
||||
if(exonet.address == target_address)
|
||||
return exonet.holder
|
||||
return null
|
||||
@@ -124,7 +124,7 @@ var/global/list/all_exonet_connections = list()
|
||||
var/obj/machinery/exonet_node/node = get_exonet_node()
|
||||
if(!node) // Telecomms went boom, ion storm, etc.
|
||||
return FALSE
|
||||
for(var/datum/exonet_protocol/exonet in all_exonet_connections)
|
||||
for(var/datum/exonet_protocol/exonet in GLOB.all_exonet_connections)
|
||||
if(exonet.address == target_address)
|
||||
node.write_log(src.address, target_address, data_type, content)
|
||||
return exonet.receive_message(holder, address, data_type, content)
|
||||
|
||||
@@ -192,10 +192,10 @@ we'll only update it when it changes. The PDA_Manifest global list is zeroed ou
|
||||
using /datum/datacore/proc/manifest_inject( ), or manifest_insert( )
|
||||
*/
|
||||
|
||||
var/global/list/PDA_Manifest = list()
|
||||
GLOBAL_LIST_EMPTY(PDA_Manifest)
|
||||
|
||||
/datum/datacore/proc/get_manifest_list()
|
||||
if(PDA_Manifest.len)
|
||||
if(GLOB.PDA_Manifest.len)
|
||||
return
|
||||
var/list/heads = list()
|
||||
var/list/sec = list()
|
||||
@@ -282,7 +282,7 @@ var/global/list/PDA_Manifest = list()
|
||||
bot[++bot.len] = list("name" = robot.real_name, "rank" = "[robot.modtype] [robot.braintype]", "active" = "Active")
|
||||
|
||||
|
||||
PDA_Manifest = list(
|
||||
GLOB.PDA_Manifest = list(
|
||||
list("cat" = "Command", "elems" = heads),
|
||||
list("cat" = "Security", "elems" = sec),
|
||||
list("cat" = "Engineering", "elems" = eng),
|
||||
@@ -536,8 +536,8 @@ var/global/list/PDA_Manifest = list()
|
||||
return M
|
||||
|
||||
/datum/datacore/proc/ResetPDAManifest()
|
||||
if(PDA_Manifest.len)
|
||||
PDA_Manifest.Cut()
|
||||
if(GLOB.PDA_Manifest.len)
|
||||
GLOB.PDA_Manifest.Cut()
|
||||
|
||||
/proc/find_general_record(field, value)
|
||||
return find_record(field, value, data_core.general)
|
||||
|
||||
@@ -126,8 +126,8 @@
|
||||
out += "Assigned role: [assigned_role]. <a href='byond://?src=\ref[src];[HrefToken()];role_edit=1'>Edit</a><br>"
|
||||
out += "<hr>"
|
||||
out += "Factions and special roles:<br><table>"
|
||||
for(var/antag_type in all_antag_types)
|
||||
var/datum/antagonist/antag = all_antag_types[antag_type]
|
||||
for(var/antag_type in GLOB.all_antag_types)
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
|
||||
out += "[antag.get_panel_entry(src)]"
|
||||
out += "</table><hr>"
|
||||
out += span_bold("Objectives") + "</br>"
|
||||
@@ -155,7 +155,7 @@
|
||||
if(!check_rights(R_ADMIN|R_FUN|R_EVENT)) return
|
||||
|
||||
if(href_list["add_antagonist"])
|
||||
var/datum/antagonist/antag = all_antag_types[href_list["add_antagonist"]]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["add_antagonist"]]
|
||||
if(antag)
|
||||
if(antag.add_antagonist(src, 1, 1, 0, 1, 1)) // Ignore equipment and role type for this.
|
||||
log_admin("[key_name_admin(usr)] made [key_name(src)] into a [antag.role_text].")
|
||||
@@ -163,19 +163,19 @@
|
||||
to_chat(usr, span_warning("[src] could not be made into a [antag.role_text]!"))
|
||||
|
||||
else if(href_list["remove_antagonist"])
|
||||
var/datum/antagonist/antag = all_antag_types[href_list["remove_antagonist"]]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["remove_antagonist"]]
|
||||
if(antag) antag.remove_antagonist(src)
|
||||
|
||||
else if(href_list["equip_antagonist"])
|
||||
var/datum/antagonist/antag = all_antag_types[href_list["equip_antagonist"]]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["equip_antagonist"]]
|
||||
if(antag) antag.equip(src.current)
|
||||
|
||||
else if(href_list["unequip_antagonist"])
|
||||
var/datum/antagonist/antag = all_antag_types[href_list["unequip_antagonist"]]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["unequip_antagonist"]]
|
||||
if(antag) antag.unequip(src.current)
|
||||
|
||||
else if(href_list["move_antag_to_spawn"])
|
||||
var/datum/antagonist/antag = all_antag_types[href_list["move_antag_to_spawn"]]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["move_antag_to_spawn"]]
|
||||
if(antag) antag.place_mob(src.current)
|
||||
|
||||
else if (href_list["role_edit"])
|
||||
|
||||
@@ -25,7 +25,7 @@ GLOBAL_VAR_INIT(prey_eaten_roundstat, 0) //VOREStation Edit - Obviously
|
||||
GLOBAL_VAR_INIT(prey_absorbed_roundstat, 0) //VOREStation Edit - Obviously
|
||||
GLOBAL_VAR_INIT(prey_digested_roundstat, 0) //VOREStation Edit - Obviously
|
||||
GLOBAL_VAR_INIT(items_digested_roundstat, 0) //VOREStation Edit - Obviously
|
||||
var/global/list/security_printer_tickets = list() //VOREStation Edit
|
||||
GLOBAL_LIST_EMPTY(security_printer_tickets) //VOREStation Edit
|
||||
|
||||
|
||||
/hook/roundend/proc/RoundTrivia()//bazinga
|
||||
@@ -57,15 +57,15 @@ var/global/list/security_printer_tickets = list() //VOREStation Edit
|
||||
valid_stats_list.Add("The disposal system flushed a whole [GLOB.disposals_flush_shift_roundstat] times for this shift. We should really invest in waste treatement.")
|
||||
|
||||
//VOREStation add Start - Ticket time!
|
||||
if(security_printer_tickets.len)
|
||||
valid_stats_list.Add(span_danger("[security_printer_tickets.len] unique security tickets were issued today!") + "<br>Examples include:")
|
||||
if(GLOB.security_printer_tickets.len)
|
||||
valid_stats_list.Add(span_danger("[GLOB.security_printer_tickets.len] unique security tickets were issued today!") + "<br>Examples include:")
|
||||
var/good_num = 5
|
||||
var/ourticket
|
||||
while(good_num > 0)
|
||||
ourticket = null
|
||||
if(security_printer_tickets.len)
|
||||
ourticket = pick(security_printer_tickets)
|
||||
security_printer_tickets -= ourticket
|
||||
if(GLOB.security_printer_tickets.len)
|
||||
ourticket = pick(GLOB.security_printer_tickets)
|
||||
GLOB.security_printer_tickets -= ourticket
|
||||
if(ourticket)
|
||||
valid_stats_list.Add(span_bold("-")+"\"[ourticket]\"")
|
||||
good_num--
|
||||
|
||||
@@ -6,26 +6,26 @@
|
||||
//NEW NOTE: Do NOT set the price of any crates below 7 points. Doing so allows infinite points.
|
||||
//NOTE NOTE: Hidden var is now deprecated, whoever removed support for it should've removed the var altogether
|
||||
|
||||
//var/list/all_supply_groups = list("Operations","Security","Hospitality","Engineering","Atmospherics","Medical","Reagents","Reagent Cartridges","Science","Hydroponics", "Supply", "Miscellaneous")
|
||||
var/list/all_supply_groups = list("Atmospherics",
|
||||
"Costumes",
|
||||
"Engineering",
|
||||
"Hospitality",
|
||||
"Hydroponics",
|
||||
"Materials",
|
||||
"Medical",
|
||||
"Miscellaneous",
|
||||
"Munitions",
|
||||
"Reagents",
|
||||
"Reagent Cartridges",
|
||||
"Recreation",
|
||||
"Robotics",
|
||||
"Science",
|
||||
"Security",
|
||||
"Supplies",
|
||||
"Vendor Refills",
|
||||
"Hardsuits",
|
||||
"Voidsuits")
|
||||
//GLOBAL_LIST_INIT(all_supply_groups, list("Operations","Security","Hospitality","Engineering","Atmospherics","Medical","Reagents","Reagent Cartridges","Science","Hydroponics", "Supply", "Miscellaneous"))
|
||||
GLOBAL_LIST_INIT(all_supply_groups, list("Atmospherics",
|
||||
"Costumes",
|
||||
"Engineering",
|
||||
"Hospitality",
|
||||
"Hydroponics",
|
||||
"Materials",
|
||||
"Medical",
|
||||
"Miscellaneous",
|
||||
"Munitions",
|
||||
"Reagents",
|
||||
"Reagent Cartridges",
|
||||
"Recreation",
|
||||
"Robotics",
|
||||
"Science",
|
||||
"Security",
|
||||
"Supplies",
|
||||
"Vendor Refills",
|
||||
"Hardsuits",
|
||||
"Voidsuits"))
|
||||
|
||||
/datum/supply_pack
|
||||
var/name = null
|
||||
|
||||
Reference in New Issue
Block a user