Conversion many Globals to Managed Globals (Part 1) (#17121)

* Conversion of some Globals to Managed Globals

* Fix

* for later

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-04-17 14:16:53 -04:00
committed by GitHub
co-authored by Kashargul
parent 6a47a779d5
commit 21dcf0555b
229 changed files with 1227 additions and 1220 deletions
+1 -1
View File
@@ -86,7 +86,7 @@
qdel(src)
/obj/item/antag_spawner/technomancer_apprentice/equip_antag(mob/technomancer_mob)
var/datum/antagonist/technomancer/antag_datum = all_antag_types[MODE_TECHNOMANCER]
var/datum/antagonist/technomancer/antag_datum = GLOB.all_antag_types[MODE_TECHNOMANCER]
antag_datum.equip_apprentice(technomancer_mob)
@@ -307,7 +307,7 @@
// Update manifest'
if(data_core)
data_core.get_manifest_list()
data["manifest"] = PDA_Manifest
data["manifest"] = GLOB.PDA_Manifest
data["mapRef"] = map_name
return data
@@ -2,7 +2,7 @@
//
// Allows ghosts to roleplay with crewmembers without having to commit to joining the round, and also allows communications between two communicators.
var/global/list/obj/item/communicator/all_communicators = list()
GLOBAL_LIST_EMPTY_TYPED(all_communicators, /obj/item/communicator)
// List of core tabs the communicator can switch to
#define HOMETAB 1
@@ -97,8 +97,8 @@ var/global/list/obj/item/communicator/all_communicators = list()
// assign the device to the holder's name automatically in a spectacularly shitty way.
/obj/item/communicator/Initialize(mapload)
. = ..()
all_communicators += src
all_communicators = sortAtom(all_communicators)
GLOB.all_communicators += src
GLOB.all_communicators = sortAtom(GLOB.all_communicators)
node = get_exonet_node()
START_PROCESSING(SSobj, src)
camera = new(src)
@@ -187,7 +187,7 @@ var/global/list/obj/item/communicator/all_communicators = list()
src.known_devices.Cut()
if(!get_connection_to_tcomms()) //If the network's down, we can't see anything.
return
for(var/obj/item/communicator/comm in all_communicators)
for(var/obj/item/communicator/comm in GLOB.all_communicators)
if(!comm || !comm.exonet || !comm.exonet.address || comm.exonet.address == src.exonet.address) //Don't add addressless devices, and don't add ourselves.
continue
src.known_devices |= comm
@@ -314,7 +314,7 @@ var/global/list/obj/item/communicator/all_communicators = list()
node = null
//Clean up references that might point at us
all_communicators -= src
GLOB.all_communicators -= src
STOP_PROCESSING(SSobj, src)
listening_objects.Remove(src)
QDEL_NULL(camera)
@@ -140,7 +140,7 @@
return
var/list/choices = list()
for(var/obj/item/communicator/comm in all_communicators)
for(var/obj/item/communicator/comm in GLOB.all_communicators)
if(!comm.network_visibility || !comm.exonet || !comm.exonet.address)
continue
choices.Add(comm)
@@ -306,7 +306,7 @@
return
var/list/choices = list()
for(var/obj/item/communicator/comm in all_communicators)
for(var/obj/item/communicator/comm in GLOB.all_communicators)
if(!comm.network_visibility || !comm.exonet || !comm.exonet.address)
continue
choices.Add(comm)
@@ -194,7 +194,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
//The actual options
if(href_list["mindscan"])
if(!target.mind || (target.mind.name in prevent_respawns))
if(!target.mind || (target.mind.name in GLOB.prevent_respawns))
to_chat(usr,span_warning("Target seems totally braindead."))
return
@@ -231,7 +231,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
return
if(href_list["mindsteal"])
if(!target.mind || (target.mind.name in prevent_respawns))
if(!target.mind || (target.mind.name in GLOB.prevent_respawns))
to_chat(usr,span_warning("Target seems totally braindead."))
return
@@ -41,7 +41,7 @@
p.name = "Security Citation: [ticket_name]"
playsound(user, 'sound/items/ticket_printer.ogg', 75, 1)
security_printer_tickets |= details
GLOB.security_printer_tickets |= details
log_and_message_admins("has issued '[ticket_name]' a security citation: \"[details]\"", user)
last_print = world.time
@@ -108,8 +108,8 @@ var/datum/uplink_random_selection/all_uplink_selection = new/datum/uplink_random
#ifdef DEBUG
/proc/debug_uplink_purchage_log()
for(var/antag_type in all_antag_types)
var/datum/antagonist/A = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
A.print_player_summary()
/proc/debug_uplink_item_assoc_list()
+2 -2
View File
@@ -166,7 +166,7 @@
return
//extend the offer of battle to the other mech
var/datum/gender/T = gender_datums[user.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
to_chat(user, span_notice("You offer battle to [target.name]!"))
to_chat(target, span_notice(span_bold("[user.name] wants to battle with [T.His] [name]!") + " " + span_italics("Attack them with a toy mech to initiate combat.")))
wants_to_battle = TRUE
@@ -393,7 +393,7 @@
/obj/item/toy/mecha/proc/check_battle_start(mob/living/carbon/user, obj/item/toy/mecha/attacker, mob/living/carbon/target)
var/datum/gender/T
if(target)
T = gender_datums[target.get_visible_gender()] // Doing this because Polaris Code has shitty gender datums and it's clunkier than FUCK.
T = GLOB.gender_datums[target.get_visible_gender()] // Doing this because Polaris Code has shitty gender datums and it's clunkier than FUCK.
if(attacker && attacker.in_combat)
to_chat(user, span_notice("[target ? T.His : "Your" ] [attacker.name] is in combat."))
if(target)
+2 -2
View File
@@ -29,7 +29,7 @@
temp_blade.attack_self()
/obj/item/cane/concealed/attack_self(var/mob/user)
var/datum/gender/T = gender_datums[user.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
if(concealed_blade)
user.visible_message(span_warning("[user] has unsheathed \a [concealed_blade] from [T.his] [src]!"), "You unsheathe \the [concealed_blade] from \the [src].")
// Calling drop/put in hands to properly call item drop/pickup procs
@@ -46,7 +46,7 @@
/obj/item/cane/concealed/attackby(var/obj/item/material/sword/katana/caneblade/W, var/mob/user)
if(!src.concealed_blade && istype(W))
var/datum/gender/T = gender_datums[user.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
user.visible_message(span_warning("[user] has sheathed \a [W] into [T.his] [src]!"), "You sheathe \the [W] into \the [src].")
playsound(src, 'sound/weapons/holster/sheathin.ogg', 50, 1)
user.drop_from_inventory(W)
@@ -25,7 +25,7 @@
/obj/item/circuitboard/security/engineering/Initialize(mapload)
. = ..()
network = engineering_networks
network = GLOB.engineering_networks
/obj/item/circuitboard/security/mining
name = T_BOARD("mining camera monitor")
+1 -1
View File
@@ -127,7 +127,7 @@ var/last_chew = 0
var/obj/item/organ/external/O = H.organs_by_name[(H.hand ? BP_L_HAND : BP_R_HAND)]
if (!O) return
var/datum/gender/T = gender_datums[H.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[H.get_visible_gender()]
var/s = span_warning("[H.name] chews on [T.his] [O.name]!")
H.visible_message(s, span_warning("You chew on your [O.name]!"))
@@ -542,7 +542,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
STOP_PROCESSING(SSobj, src)
if ("emp")
var/obj/item/radio/headset/a = new /obj/item/radio/headset/heads/captain(null)
var/name = prob(50) ? t.name : pick(teleportlocs)
var/name = prob(50) ? t.name : pick(GLOB.teleportlocs)
a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm")
// a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm", "Security")
// a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm", "Medical")
@@ -102,7 +102,7 @@
to_chat(user, span_notice("\The [src] does not seem to have power."))
return
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
if (active)
if ((CLUMSY in user.mutations) && prob(50))
user.visible_message(span_danger("\The [user] accidentally cuts [TU.himself] with \the [src]."),\
+2 -2
View File
@@ -46,10 +46,10 @@
return
/obj/item/teleportation_scroll/proc/teleportscroll(var/mob/user)
var/A = tgui_input_list(user, "Area to jump to:", "Teleportation Scroll", teleportlocs)
var/A = tgui_input_list(user, "Area to jump to:", "Teleportation Scroll", GLOB.teleportlocs)
if(!A)
return
var/area/thearea = teleportlocs[A]
var/area/thearea = GLOB.teleportlocs[A]
if (user.stat || user.restrained())
return