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:
AffectedArc07
2020-03-20 21:56:37 -06:00
committed by GitHub
parent c8dbd0190e
commit 210f8badf4
667 changed files with 4243 additions and 4240 deletions
+2 -2
View File
@@ -265,8 +265,8 @@
/obj/item/paper/contract/infernal/power/FulfillContract(mob/living/carbon/human/user = target.current, blood = 0)
if(!user.dna)
return -1
user.dna.SetSEState(HULKBLOCK,1)
genemutcheck(user, HULKBLOCK,null,MUTCHK_FORCED)
user.dna.SetSEState(GLOB.hulkblock,1)
genemutcheck(user, GLOB.hulkblock,null,MUTCHK_FORCED)
// Demonic power gives you consequenceless hulk
user.gene_stability += GENE_INSTABILITY_MAJOR
if(ishuman(user))
+6 -6
View File
@@ -1,6 +1,6 @@
// Fax datum - holds all faxes sent during the round
var/list/faxes = list()
var/list/adminfaxes = list()
GLOBAL_LIST_EMPTY(faxes)
GLOBAL_LIST_EMPTY(adminfaxes)
/datum/fax
var/name = "fax"
@@ -12,13 +12,13 @@ var/list/adminfaxes = list()
var/sent_at = null
/datum/fax/New()
faxes += src
GLOB.faxes += src
/datum/fax/admin
var/list/reply_to = null
/datum/fax/admin/New()
adminfaxes += src
GLOB.adminfaxes += src
// Fax panel - lets admins check all faxes sent during the round
/client/proc/fax_panel()
@@ -37,7 +37,7 @@ var/list/adminfaxes = list()
html += "<h2>Admin Faxes</h2>"
html += "<table>"
html += "<tr style='font-weight:bold;'><td width='150px'>Name</td><td width='150px'>From Department</td><td width='150px'>To Department</td><td width='75px'>Sent At</td><td width='150px'>Sent By</td><td width='50px'>View</td><td width='50px'>Reply</td><td width='75px'>Replied To</td></td></tr>"
for(var/datum/fax/admin/A in adminfaxes)
for(var/datum/fax/admin/A in GLOB.adminfaxes)
html += "<tr>"
html += "<td>[A.name]</td>"
html += "<td>[A.from_department]</td>"
@@ -66,7 +66,7 @@ var/list/adminfaxes = list()
html += "<h2>Departmental Faxes</h2>"
html += "<table>"
html += "<tr style='font-weight:bold;'><td width='150px'>Name</td><td width='150px'>From Department</td><td width='150px'>To Department</td><td width='75px'>Sent At</td><td width='150px'>Sent By</td><td width='175px'>View</td></td></tr>"
for(var/datum/fax/F in faxes)
for(var/datum/fax/F in GLOB.faxes)
html += "<tr>"
html += "<td>[F.name]</td>"
html += "<td>[F.from_department]</td>"
+23 -23
View File
@@ -1,9 +1,9 @@
var/list/obj/machinery/photocopier/faxmachine/allfaxes = list()
var/list/admin_departments = list("Central Command")
var/list/hidden_admin_departments = list("Syndicate")
var/list/alldepartments = list()
var/list/hidden_departments = list()
var/global/list/fax_blacklist = list()
GLOBAL_LIST_EMPTY(allfaxes)
GLOBAL_LIST_INIT(admin_departments, list("Central Command"))
GLOBAL_LIST_INIT(hidden_admin_departments, list("Syndicate"))
GLOBAL_LIST_EMPTY(alldepartments)
GLOBAL_LIST_EMPTY(hidden_departments)
GLOBAL_LIST_EMPTY(fax_blacklist)
/obj/machinery/photocopier/faxmachine
name = "fax machine"
@@ -33,13 +33,13 @@ var/global/list/fax_blacklist = list()
/obj/machinery/photocopier/faxmachine/New()
..()
allfaxes += src
GLOB.allfaxes += src
update_network()
/obj/machinery/photocopier/faxmachine/proc/update_network()
if(department != "Unknown")
if(!(("[department]" in alldepartments) || ("[department]" in hidden_departments) || ("[department]" in admin_departments) || ("[department]" in hidden_admin_departments)))
alldepartments |= department
if(!(("[department]" in GLOB.alldepartments) || ("[department]" in GLOB.hidden_departments) || ("[department]" in GLOB.admin_departments) || ("[department]" in GLOB.hidden_admin_departments)))
GLOB.alldepartments |= department
/obj/machinery/photocopier/faxmachine/longrange
name = "long range fax machine"
@@ -55,7 +55,7 @@ var/global/list/fax_blacklist = list()
/obj/machinery/photocopier/faxmachine/longrange/syndie/update_network()
if(department != "Unknown")
hidden_departments |= department
GLOB.hidden_departments |= department
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user)
ui_interact(user)
@@ -86,7 +86,7 @@ var/global/list/fax_blacklist = list()
ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450)
ui.open()
/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
var/is_authenticated = is_authenticated(user)
@@ -109,7 +109,7 @@ var/global/list/fax_blacklist = list()
data["paperinserted"] = 0
data["destination"] = destination
data["cooldown"] = sendcooldown
if((destination in admin_departments) || (destination in hidden_admin_departments))
if((destination in GLOB.admin_departments) || (destination in GLOB.hidden_admin_departments))
data["respectcooldown"] = 1
else
data["respectcooldown"] = 0
@@ -130,7 +130,7 @@ var/global/list/fax_blacklist = list()
var/is_authenticated = is_authenticated(usr)
if(href_list["send"])
if(copyitem && is_authenticated)
if((destination in admin_departments) || (destination in hidden_admin_departments))
if((destination in GLOB.admin_departments) || (destination in GLOB.hidden_admin_departments))
send_admin_fax(usr, destination)
else
sendfax(destination, usr)
@@ -163,18 +163,18 @@ var/global/list/fax_blacklist = list()
if(href_list["dept"])
if(is_authenticated)
var/lastdestination = destination
var/list/combineddepartments = alldepartments.Copy()
var/list/combineddepartments = GLOB.alldepartments.Copy()
if(long_range_enabled)
combineddepartments += admin_departments.Copy()
combineddepartments += GLOB.admin_departments.Copy()
if(emagged)
combineddepartments += hidden_admin_departments.Copy()
combineddepartments += hidden_departments.Copy()
combineddepartments += GLOB.hidden_admin_departments.Copy()
combineddepartments += GLOB.hidden_departments.Copy()
if(syndie_restricted)
combineddepartments = hidden_admin_departments.Copy()
combineddepartments += hidden_departments.Copy()
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
combineddepartments = GLOB.hidden_admin_departments.Copy()
combineddepartments += GLOB.hidden_departments.Copy()
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(F.emagged)//we can contact emagged faxes on the station
combineddepartments |= F.department
@@ -184,7 +184,7 @@ var/global/list/fax_blacklist = list()
if(href_list["auth"])
if(!is_authenticated && scan)
if(scan.registered_name in fax_blacklist)
if(scan.registered_name in GLOB.fax_blacklist)
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
else if(check_access(scan))
authenticated = 1
@@ -252,7 +252,7 @@ var/global/list/fax_blacklist = list()
use_power(200)
var/success = 0
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(F.department == destination)
success = F.receivefax(copyitem)
@@ -324,7 +324,7 @@ var/global/list/fax_blacklist = list()
message_admins(sender, "CENTCOM FAX", destination, copyitem, "#006100")
if("Syndicate")
message_admins(sender, "SYNDICATE FAX", destination, copyitem, "#DC143C")
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if(F.department == destination)
F.receivefax(copyitem)
sendcooldown = cooldown_time
+8 -8
View File
@@ -119,9 +119,9 @@
/obj/structure/filingcabinet/security/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
for(var/datum/data/record/G in GLOB.data_core.general)
var/datum/data/record/S
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"])
S = R
break
@@ -153,9 +153,9 @@
/obj/structure/filingcabinet/medical/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
for(var/datum/data/record/G in GLOB.data_core.general)
var/datum/data/record/M
for(var/datum/data/record/R in data_core.medical)
for(var/datum/data/record/R in GLOB.data_core.medical)
if(R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"])
M = R
break
@@ -183,7 +183,7 @@
* Employment contract Cabinets
*/
var/list/employmentCabinets = list()
GLOBAL_LIST_EMPTY(employmentCabinets)
/obj/structure/filingcabinet/employment
var/cooldown = 0
@@ -191,16 +191,16 @@ var/list/employmentCabinets = list()
var/virgin = 1
/obj/structure/filingcabinet/employment/New()
employmentCabinets += src
GLOB.employmentCabinets += src
return ..()
/obj/structure/filingcabinet/employment/Destroy()
employmentCabinets -= src
GLOB.employmentCabinets -= src
return ..()
/obj/structure/filingcabinet/employment/proc/fillCurrent()
//This proc fills the cabinet with the current crew.
for(var/record in data_core.locked)
for(var/record in GLOB.data_core.locked)
var/datum/data/record/G = record
if(!G)
continue
+4 -4
View File
@@ -677,10 +677,10 @@
to_chat(H, "<span class='userdanger'>You feel surrounded by sadness. Sadness... and HONKS!</span>")
H.makeCluwne()
else if(myeffect == "Demote")
event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
else if(myeffect == "Demote with Bot")
event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
for(var/datum/data/record/R in sortRecord(data_core.security))
GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
for(var/datum/data/record/R in sortRecord(GLOB.data_core.security))
if(R.fields["name"] == target.real_name)
R.fields["criminal"] = "*Arrest*"
update_all_mob_security_hud()
@@ -689,7 +689,7 @@
new /obj/effect/portal(T)
new /mob/living/simple_animal/bot/secbot(T)
else if(myeffect == "Revoke Fax Access")
fax_blacklist += target.real_name
GLOB.fax_blacklist += target.real_name
if(fax)
fax.authenticated = 0
else if(myeffect == "Angry Fax Machine")
+6 -6
View File
@@ -64,14 +64,14 @@
if(toner <= 0)
break
if(copier_items_printed >= copier_max_items) //global vars defined in misc.dm
if(GLOB.copier_items_printed >= GLOB.copier_max_items) //global vars defined in misc.dm
if(prob(10))
visible_message("<span class='warning'>The printer screen reads \"PC LOAD LETTER\".</span>")
else
visible_message("<span class='warning'>The printer screen reads \"PHOTOCOPIER NETWORK OFFLINE, PLEASE CONTACT SYSTEM ADMINISTRATOR\".</span>")
if(!copier_items_printed_logged)
message_admins("Photocopier cap of [copier_max_items] papers reached, all photocopiers are now disabled. This may be the cause of any lag.")
copier_items_printed_logged = TRUE
if(!GLOB.copier_items_printed_logged)
message_admins("Photocopier cap of [GLOB.copier_max_items] papers reached, all photocopiers are now disabled. This may be the cause of any lag.")
GLOB.copier_items_printed_logged = TRUE
break
if(emag_cooldown > world.time)
@@ -98,7 +98,7 @@
else
to_chat(usr, "<span class='warning'>\The [copyitem] can't be copied by \the [src].</span>")
break
copier_items_printed++
GLOB.copier_items_printed++
use_power(active_power_usage)
updateUsrDialog()
else if(href_list["remove"])
@@ -184,7 +184,7 @@
/obj/machinery/photocopier/wrench_act(mob/user, obj/item/I)
. = TRUE
default_unfasten_wrench(user, I)
/obj/machinery/photocopier/proc/copy(var/obj/item/paper/copy)
var/obj/item/paper/c = new /obj/item/paper (loc)
c.info = copy.info
+3 -3
View File
@@ -179,7 +179,7 @@
qdel(C)
var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","shadow","ghostian2")
GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","horror","shadow","ghostian2"))
/obj/item/camera/spooky
name = "camera obscura"
@@ -240,7 +240,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s
if(O.following)
continue
if(user.mind && !(user.mind.assigned_role == "Chaplain"))
atoms.Add(image('icons/mob/mob.dmi', O.loc, pick(SpookyGhosts), 4, SOUTH))
atoms.Add(image('icons/mob/mob.dmi', O.loc, pick(GLOB.SpookyGhosts), 4, SOUTH))
else
atoms.Add(image('icons/mob/mob.dmi', O.loc, "ghost", 4, SOUTH))
else//its not a ghost
@@ -544,7 +544,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s
src.icon_state = icon_on
camera = new /obj/machinery/camera(src)
camera.network = list("news")
cameranet.removeCamera(camera)
GLOB.cameranet.removeCamera(camera)
camera.c_tag = user.name
to_chat(user, "You switch the camera [on ? "on" : "off"].")