Replace global all_areas list with world.

It ends up having similar performance, so might as well not bother with all_areas.
This commit is contained in:
Leshana
2020-04-05 18:01:29 -04:00
parent 859036b7cd
commit 262faa38e4
17 changed files with 23 additions and 26 deletions

View File

@@ -676,7 +676,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
//Returns: all the areas in the world
/proc/return_areas()
var/list/area/areas = list()
for(var/area/A in all_areas)
for(var/area/A in world)
areas += A
return areas
@@ -694,7 +694,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/areas = new/list()
for(var/area/N in all_areas)
for(var/area/N in world)
if(istype(N, areatype)) areas += N
return areas
@@ -708,7 +708,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/turfs = new/list()
for(var/area/N in all_areas)
for(var/area/N in world)
if(istype(N, areatype))
for(var/turf/T in N) turfs += T
return turfs
@@ -723,7 +723,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/atoms = new/list()
for(var/area/N in all_areas)
for(var/area/N in world)
if(istype(N, areatype))
for(var/atom/A in N)
atoms += A

View File

@@ -96,7 +96,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
evac = 1
emergency_shuttle_called.Announce(replacetext(using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s"))
for(var/area/A in all_areas)
for(var/area/A in world)
if(istype(A, /area/hallway))
A.readyalert()
@@ -128,7 +128,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
if (evac)
emergency_shuttle_recalled.Announce(using_map.emergency_shuttle_recall_message)
for(var/area/A in all_areas)
for(var/area/A in world)
if(istype(A, /area/hallway))
A.readyreset()
evac = 0

View File

@@ -46,8 +46,6 @@
/area/New()
uid = ++global_uid
all_areas += src //Replace with /area in world? Byond optimizes X in world loops.
..()
/area/Initialize()
@@ -401,7 +399,7 @@ var/list/mob/living/forced_ambiance_list = new
var/list/teleportlocs = list()
/hook/startup/proc/setupTeleportLocs()
for(var/area/AR in all_areas)
for(var/area/AR in world)
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
if(teleportlocs.Find(AR.name)) continue
var/turf/picked = pick(get_area_turfs(AR.type))
@@ -416,7 +414,7 @@ var/list/teleportlocs = list()
var/list/ghostteleportlocs = list()
/hook/startup/proc/setupGhostTeleportLocs()
for(var/area/AR in all_areas)
for(var/area/AR in world)
if(ghostteleportlocs.Find(AR.name)) continue
if(istype(AR, /area/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops/centcom))
ghostteleportlocs += AR.name

View File

@@ -54,7 +54,7 @@ In short:
/datum/universal_state/hell/proc/AreaSet()
for(var/area/A in all_areas)
for(var/area/A in world)
if(!istype(A,/area) || istype(A, /area/space))
continue

View File

@@ -84,7 +84,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
return
/datum/universal_state/supermatter_cascade/proc/AreaSet()
for(var/area/A in all_areas)
for(var/area/A in world)
if(!istype(A,/area) || istype(A, /area/space) || istype(A,/area/beach))
continue

View File

@@ -169,7 +169,7 @@ var/hadevent = 0
var/list/area/areas = list()
for(var/area/A in all_areas)
for(var/area/A in world)
if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
areas += A

View File

@@ -51,7 +51,7 @@
else if(ispath(control_area))
control_area = locate(control_area)
else if(istext(control_area))
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.name && A.name==control_area)
control_area = A
break

View File

@@ -5,7 +5,6 @@
// Items that ask to be called every cycle.
var/global/datum/datacore/data_core = null
var/global/list/all_areas = list()
var/global/list/machines = list() // ALL Machines, wether processing or not.
var/global/list/processing_machines = list() // TODO - Move into SSmachines
var/global/list/processing_power_items = list() // TODO - Move into SSmachines

View File

@@ -16,7 +16,7 @@
return
gravity_is_on = !gravity_is_on
for(var/area/A in all_areas)
for(var/area/A in world)
A.gravitychange(gravity_is_on)
feedback_inc("admin_secrets_fun_used",1)

View File

@@ -341,7 +341,7 @@
var/list/areas_with_intercom = list()
var/list/areas_with_camera = list()
for(var/area/A in all_areas)
for(var/area/A in world)
if(!(A.type in areas_all))
areas_all.Add(A.type)

View File

@@ -15,7 +15,7 @@
/datum/event/gravity/start()
gravity_is_on = 0
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.z in zLevels)
A.gravitychange(gravity_is_on)
@@ -23,7 +23,7 @@
if(!gravity_is_on)
gravity_is_on = 1
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.z in zLevels)
A.gravitychange(gravity_is_on)

View File

@@ -41,7 +41,7 @@
/datum/event/prison_break/start()
for(var/area/A in all_areas)
for(var/area/A in world)
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
areas += A

View File

@@ -22,12 +22,12 @@
Please stand by while the gravity system reinitializes.", "Gravity Failure")
/datum/event2/event/gravity/start()
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.z in get_location_z_levels())
A.gravitychange(FALSE)
/datum/event2/event/gravity/end()
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.z in get_location_z_levels())
A.gravitychange(TRUE)

View File

@@ -177,7 +177,7 @@
/datum/event2/event/prison_break/set_up()
for(var/area/A in all_areas)
for(var/area/A in world)
if(is_type_in_list(A, area_types_to_break) && !is_type_in_list(A, area_types_to_ignore))
areas_to_break += A

View File

@@ -1,6 +1,6 @@
// Create lighting overlays on all turfs with dynamic lighting in areas with dynamic lighting.
/proc/create_all_lighting_overlays()
for(var/area/A in all_areas)
for(var/area/A in world)
if(!A.dynamic_lighting)
continue
for(var/turf/T in A)

View File

@@ -352,7 +352,7 @@ var/global/use_preloader = FALSE
var/atom/instance
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
var/atype = members[index]
for(var/area/A in all_areas)
for(var/area/A in world)
if(A.type == atype)
instance = A
break

View File

@@ -41,7 +41,7 @@
var/list/zs_to_test = using_map.unit_test_z_levels || list(1) //Either you set it, or you just get z1
for(var/area/A in all_areas)
for(var/area/A in world)
if((A.z in zs_to_test) && !(A.type in exempt_areas))
area_test_count++
var/area_good = 1