mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +01:00
Turn more unmanaged global vars into GLOB (#20446)
Turned a ton of unmanaged globals into managed globals. Refactored some UT output. Removed some unused things, including vars. Added a test to ensure people don't keep adding new unmanaged vars.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
|
||||
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as")
|
||||
GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","monkey","alien","as"))
|
||||
|
||||
/proc/generate_ahelp_key_words(var/mob/mob, var/msg)
|
||||
var/list/surnames = list()
|
||||
@@ -38,7 +38,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
for(var/original_word in msglist)
|
||||
var/word = ckey(original_word)
|
||||
if(word)
|
||||
if(!(word in adminhelp_ignored_words))
|
||||
if(!(word in GLOB.adminhelp_ignored_words))
|
||||
if(word == "ai" && !ai_found)
|
||||
ai_found = 1
|
||||
msg += "<b>[original_word] <A HREF='?_src_=holder;adminchecklaws=[REF(mob)]'>(CL)</A></b> "
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
set category = "Debug"
|
||||
|
||||
to_chat(usr, "<b>Jobbans active in this round.</b>")
|
||||
for(var/t in jobban_keylist)
|
||||
for(var/t in GLOB.jobban_keylist)
|
||||
to_chat(usr, "[t]")
|
||||
|
||||
/client/proc/print_jobban_old_filter()
|
||||
@@ -176,6 +176,6 @@
|
||||
return
|
||||
|
||||
to_chat(usr, "<b>Jobbans active in this round.</b>")
|
||||
for(var/t in jobban_keylist)
|
||||
for(var/t in GLOB.jobban_keylist)
|
||||
if(findtext(t, filter))
|
||||
to_chat(usr, "[t]")
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
//- Identify how hard it is to break into the area and where the weak points are
|
||||
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
|
||||
|
||||
var/camera_range_display_status = 0
|
||||
var/intercom_range_display_status = 0
|
||||
GLOBAL_VAR_INIT(camera_range_display_status, 0)
|
||||
GLOBAL_VAR_INIT(intercom_range_display_status, 0)
|
||||
|
||||
/obj/effect/debugging/camera_range
|
||||
icon = 'icons/480x480.dmi'
|
||||
@@ -45,17 +45,17 @@ var/intercom_range_display_status = 0
|
||||
set category = "Mapping"
|
||||
set name = "Camera Range Display"
|
||||
|
||||
if(camera_range_display_status)
|
||||
camera_range_display_status = 0
|
||||
if(GLOB.camera_range_display_status)
|
||||
GLOB.camera_range_display_status = 0
|
||||
else
|
||||
camera_range_display_status = 1
|
||||
GLOB.camera_range_display_status = 1
|
||||
|
||||
|
||||
|
||||
for(var/obj/effect/debugging/camera_range/C in world)
|
||||
qdel(C)
|
||||
|
||||
if(camera_range_display_status)
|
||||
if(GLOB.camera_range_display_status)
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
new/obj/effect/debugging/camera_range(C.loc)
|
||||
feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -108,15 +108,15 @@ var/intercom_range_display_status = 0
|
||||
set category = "Mapping"
|
||||
set name = "Intercom Range Display"
|
||||
|
||||
if(intercom_range_display_status)
|
||||
intercom_range_display_status = 0
|
||||
if(GLOB.intercom_range_display_status)
|
||||
GLOB.intercom_range_display_status = 0
|
||||
else
|
||||
intercom_range_display_status = 1
|
||||
GLOB.intercom_range_display_status = 1
|
||||
|
||||
for(var/obj/effect/debugging/marker/M in world)
|
||||
qdel(M)
|
||||
|
||||
if(intercom_range_display_status)
|
||||
if(GLOB.intercom_range_display_status)
|
||||
for(var/obj/item/device/radio/intercom/I in world)
|
||||
for(var/turf/T in orange(7,I))
|
||||
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
|
||||
@@ -124,7 +124,7 @@ var/intercom_range_display_status = 0
|
||||
qdel(F)
|
||||
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
var/list/debug_verbs = list (
|
||||
GLOBAL_LIST_INIT(debug_verbs, list(
|
||||
/client/proc/do_not_use_these
|
||||
,/client/proc/camera_view
|
||||
,/client/proc/sec_camera_report
|
||||
@@ -165,7 +165,7 @@ var/list/debug_verbs = list (
|
||||
,/client/proc/get_bad_fdoors
|
||||
,/client/proc/get_bad_doors
|
||||
,/client/proc/analyze_openturf
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
/client/proc/enable_debug_verbs()
|
||||
@@ -174,7 +174,7 @@ var/list/debug_verbs = list (
|
||||
|
||||
if(!check_rights(R_DEBUG|R_DEV)) return
|
||||
|
||||
add_verb(src, debug_verbs)
|
||||
add_verb(src, GLOB.debug_verbs)
|
||||
|
||||
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -184,7 +184,7 @@ var/list/debug_verbs = list (
|
||||
|
||||
if(!check_rights(R_DEBUG|R_DEV)) return
|
||||
|
||||
remove_verb(src, debug_verbs)
|
||||
remove_verb(src, GLOB.debug_verbs)
|
||||
|
||||
init_verbs()
|
||||
feedback_add_details("admin_verb","hDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -332,7 +332,7 @@ var/list/debug_verbs = list (
|
||||
feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
var/global/prevent_airgroup_regroup = 0
|
||||
// var/global/prevent_airgroup_regroup = 0
|
||||
|
||||
/client/proc/break_all_air_groups()
|
||||
set category = "Mapping"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/list/sounds_cache = list()
|
||||
GLOBAL_LIST_INIT_TYPED(sounds_cache, /sound, list())
|
||||
|
||||
/client/proc/play_sound(S as sound)
|
||||
set category = "Fun"
|
||||
@@ -8,7 +8,7 @@ var/list/sounds_cache = list()
|
||||
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777)
|
||||
uploaded_sound.priority = 250
|
||||
|
||||
sounds_cache += S
|
||||
GLOB.sounds_cache += S
|
||||
|
||||
if(alert("Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel")
|
||||
return
|
||||
@@ -39,7 +39,7 @@ var/list/sounds_cache = list()
|
||||
|
||||
var/list/sounds = file2list('sound/serversound_list.txt');
|
||||
sounds += "--CANCEL--"
|
||||
sounds += sounds_cache
|
||||
sounds += GLOB.sounds_cache
|
||||
|
||||
var/melody = input("Select a sound from the server to play", "Server sound list", "--CANCEL--") in sounds
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ Ccomp's first proc.
|
||||
if (G.client)
|
||||
P = G.client.prefs
|
||||
else if (G.ckey)
|
||||
P = preferences_datums[G.ckey]
|
||||
P = GLOB.preferences_datums[G.ckey]
|
||||
else
|
||||
to_chat(src, "Something went wrong, couldn't find the target's preferences datum")
|
||||
return 0
|
||||
@@ -433,9 +433,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
if(!new_character.real_name)
|
||||
if(new_character.gender == MALE)
|
||||
new_character.real_name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
|
||||
new_character.real_name = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names))
|
||||
else
|
||||
new_character.real_name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
|
||||
new_character.real_name = capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names))
|
||||
new_character.name = new_character.real_name
|
||||
|
||||
if(G_found.mind && !G_found.mind.active)
|
||||
@@ -882,7 +882,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
set category = "Admin"
|
||||
set name = "Call Evacuation"
|
||||
|
||||
if ((!( ROUND_IS_STARTED ) || !evacuation_controller))
|
||||
if ((!( ROUND_IS_STARTED ) || !GLOB.evacuation_controller))
|
||||
return
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -907,7 +907,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
return
|
||||
|
||||
var/choice = input("Is this an emergency evacuation, bluespace jump, or a crew transfer?") in list(TRANSFER_EMERGENCY, TRANSFER_CREW, TRANSFER_JUMP)
|
||||
evacuation_controller.call_evacuation(usr, choice)
|
||||
GLOB.evacuation_controller.call_evacuation(usr, choice)
|
||||
|
||||
|
||||
feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -923,7 +923,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
|
||||
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return
|
||||
|
||||
if(!ROUND_IS_STARTED || !evacuation_controller)
|
||||
if(!ROUND_IS_STARTED || !GLOB.evacuation_controller)
|
||||
return
|
||||
|
||||
if(SSatlas.current_map.shuttle_call_restarts)
|
||||
@@ -939,7 +939,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
return
|
||||
|
||||
|
||||
evacuation_controller.cancel_evacuation()
|
||||
GLOB.evacuation_controller.cancel_evacuation()
|
||||
feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] admin-cancelled the evacuation.")
|
||||
message_admins(SPAN_NOTICE("[key_name_admin(usr)] admin-cancelled the evacuation."), 1)
|
||||
@@ -956,10 +956,10 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
evacuation_controller.deny = !evacuation_controller.deny
|
||||
GLOB.evacuation_controller.deny = !GLOB.evacuation_controller.deny
|
||||
|
||||
log_admin("[key_name(src)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.")
|
||||
message_admins("[key_name_admin(usr)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.")
|
||||
log_admin("[key_name(src)] has [GLOB.evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.")
|
||||
message_admins("[key_name_admin(usr)] has [GLOB.evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.")
|
||||
|
||||
/client/proc/cmd_admin_attack_log(mob/M as mob in GLOB.mob_list)
|
||||
set category = "Special Verbs"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
var/datum/preferences/D
|
||||
var/client/C = GLOB.directory[warned_ckey]
|
||||
if(C) D = C.prefs
|
||||
else D = preferences_datums[warned_ckey]
|
||||
else D = GLOB.preferences_datums[warned_ckey]
|
||||
|
||||
if(!D)
|
||||
to_chat(src, SPAN_WARNING("Error: warn_legacy(): No such ckey found."))
|
||||
|
||||
Reference in New Issue
Block a user