mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +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,4 +1,4 @@
|
||||
var/global/list/all_beam_points
|
||||
GLOBAL_LIST_INIT_TYPED(all_beam_points, /obj/effect/map_effect/beam_point, null)
|
||||
|
||||
// Creates and manages a beam attached to itself and another beam_point.
|
||||
// You can do cool things with these such as moving the beam_point to move the beam, turning them on and off on a timer, triggered by external input, and more.
|
||||
@@ -32,7 +32,7 @@ var/global/list/all_beam_points
|
||||
var/beam_sleep_time = 3 // How often the beam updates visually. Suggested to leave this alone, 3 is already fast.
|
||||
|
||||
/obj/effect/map_effect/beam_point/Initialize()
|
||||
LAZYADD(all_beam_points, src)
|
||||
LAZYADD(GLOB.all_beam_points, src)
|
||||
if(make_beams_on_init)
|
||||
create_beams()
|
||||
if(use_timer)
|
||||
@@ -42,7 +42,7 @@ var/global/list/all_beam_points
|
||||
/obj/effect/map_effect/beam_point/Destroy()
|
||||
destroy_all_beams()
|
||||
use_timer = FALSE
|
||||
LAZYREMOVE(all_beam_points, src)
|
||||
LAZYREMOVE(GLOB.all_beam_points, src)
|
||||
return ..()
|
||||
|
||||
// This is the top level proc to make the magic happen.
|
||||
@@ -58,7 +58,7 @@ var/global/list/all_beam_points
|
||||
|
||||
// Finds a suitable beam point.
|
||||
/obj/effect/map_effect/beam_point/proc/seek_beam_point()
|
||||
for(var/obj/effect/map_effect/beam_point/point in all_beam_points)
|
||||
for(var/obj/effect/map_effect/beam_point/point in GLOB.all_beam_points)
|
||||
if(id != point.id)
|
||||
continue // Not linked together by ID.
|
||||
if(has_active_beam(point))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/list/all_portal_masters
|
||||
GLOBAL_LIST_INIT_TYPED(all_portal_masters, /obj/effect/map_effect/portal/master, null)
|
||||
|
||||
/*
|
||||
Portal map effects allow a mapper to join two distant places together, while looking somewhat seamlessly connected.
|
||||
@@ -146,7 +146,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec
|
||||
var/list/portal_lines = list()
|
||||
|
||||
/obj/effect/map_effect/portal/master/Initialize()
|
||||
LAZYADD(all_portal_masters, src)
|
||||
LAZYADD(GLOB.all_portal_masters, src)
|
||||
become_hearing_sensitive()
|
||||
find_lines()
|
||||
..()
|
||||
@@ -158,7 +158,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec
|
||||
apply_offset()
|
||||
|
||||
/obj/effect/map_effect/portal/master/Destroy()
|
||||
LAZYREMOVE(all_portal_masters, src)
|
||||
LAZYREMOVE(GLOB.all_portal_masters, src)
|
||||
for(var/thing in portal_lines)
|
||||
qdel(thing)
|
||||
return ..()
|
||||
@@ -179,7 +179,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec
|
||||
|
||||
// Connects both sides of a portal together.
|
||||
/obj/effect/map_effect/portal/master/proc/find_counterparts()
|
||||
for(var/thing in all_portal_masters)
|
||||
for(var/thing in GLOB.all_portal_masters)
|
||||
var/obj/effect/map_effect/portal/master/M = thing
|
||||
if(M == src)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user