mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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:
@@ -676,7 +676,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
|||||||
//Returns: all the areas in the world
|
//Returns: all the areas in the world
|
||||||
/proc/return_areas()
|
/proc/return_areas()
|
||||||
var/list/area/areas = list()
|
var/list/area/areas = list()
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
areas += A
|
areas += A
|
||||||
return areas
|
return areas
|
||||||
|
|
||||||
@@ -694,7 +694,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
|||||||
areatype = areatemp.type
|
areatype = areatemp.type
|
||||||
|
|
||||||
var/list/areas = new/list()
|
var/list/areas = new/list()
|
||||||
for(var/area/N in all_areas)
|
for(var/area/N in world)
|
||||||
if(istype(N, areatype)) areas += N
|
if(istype(N, areatype)) areas += N
|
||||||
return areas
|
return areas
|
||||||
|
|
||||||
@@ -708,7 +708,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
|||||||
areatype = areatemp.type
|
areatype = areatemp.type
|
||||||
|
|
||||||
var/list/turfs = new/list()
|
var/list/turfs = new/list()
|
||||||
for(var/area/N in all_areas)
|
for(var/area/N in world)
|
||||||
if(istype(N, areatype))
|
if(istype(N, areatype))
|
||||||
for(var/turf/T in N) turfs += T
|
for(var/turf/T in N) turfs += T
|
||||||
return turfs
|
return turfs
|
||||||
@@ -723,7 +723,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
|||||||
areatype = areatemp.type
|
areatype = areatemp.type
|
||||||
|
|
||||||
var/list/atoms = new/list()
|
var/list/atoms = new/list()
|
||||||
for(var/area/N in all_areas)
|
for(var/area/N in world)
|
||||||
if(istype(N, areatype))
|
if(istype(N, areatype))
|
||||||
for(var/atom/A in N)
|
for(var/atom/A in N)
|
||||||
atoms += A
|
atoms += A
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
|
|||||||
|
|
||||||
evac = 1
|
evac = 1
|
||||||
emergency_shuttle_called.Announce(replacetext(using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s"))
|
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))
|
if(istype(A, /area/hallway))
|
||||||
A.readyalert()
|
A.readyalert()
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
|
|||||||
if (evac)
|
if (evac)
|
||||||
emergency_shuttle_recalled.Announce(using_map.emergency_shuttle_recall_message)
|
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))
|
if(istype(A, /area/hallway))
|
||||||
A.readyreset()
|
A.readyreset()
|
||||||
evac = 0
|
evac = 0
|
||||||
|
|||||||
@@ -46,8 +46,6 @@
|
|||||||
|
|
||||||
/area/New()
|
/area/New()
|
||||||
uid = ++global_uid
|
uid = ++global_uid
|
||||||
all_areas += src //Replace with /area in world? Byond optimizes X in world loops.
|
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/area/Initialize()
|
/area/Initialize()
|
||||||
@@ -401,7 +399,7 @@ var/list/mob/living/forced_ambiance_list = new
|
|||||||
var/list/teleportlocs = list()
|
var/list/teleportlocs = list()
|
||||||
|
|
||||||
/hook/startup/proc/setupTeleportLocs()
|
/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(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
|
||||||
if(teleportlocs.Find(AR.name)) continue
|
if(teleportlocs.Find(AR.name)) continue
|
||||||
var/turf/picked = pick(get_area_turfs(AR.type))
|
var/turf/picked = pick(get_area_turfs(AR.type))
|
||||||
@@ -416,7 +414,7 @@ var/list/teleportlocs = list()
|
|||||||
var/list/ghostteleportlocs = list()
|
var/list/ghostteleportlocs = list()
|
||||||
|
|
||||||
/hook/startup/proc/setupGhostTeleportLocs()
|
/hook/startup/proc/setupGhostTeleportLocs()
|
||||||
for(var/area/AR in all_areas)
|
for(var/area/AR in world)
|
||||||
if(ghostteleportlocs.Find(AR.name)) continue
|
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))
|
if(istype(AR, /area/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops/centcom))
|
||||||
ghostteleportlocs += AR.name
|
ghostteleportlocs += AR.name
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ In short:
|
|||||||
|
|
||||||
|
|
||||||
/datum/universal_state/hell/proc/AreaSet()
|
/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))
|
if(!istype(A,/area) || istype(A, /area/space))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
|
|||||||
return
|
return
|
||||||
|
|
||||||
/datum/universal_state/supermatter_cascade/proc/AreaSet()
|
/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))
|
if(!istype(A,/area) || istype(A, /area/space) || istype(A,/area/beach))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ var/hadevent = 0
|
|||||||
|
|
||||||
|
|
||||||
var/list/area/areas = list()
|
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))
|
if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
|
||||||
areas += A
|
areas += A
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
else if(ispath(control_area))
|
else if(ispath(control_area))
|
||||||
control_area = locate(control_area)
|
control_area = locate(control_area)
|
||||||
else if(istext(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)
|
if(A.name && A.name==control_area)
|
||||||
control_area = A
|
control_area = A
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
// Items that ask to be called every cycle.
|
// Items that ask to be called every cycle.
|
||||||
var/global/datum/datacore/data_core = null
|
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/machines = list() // ALL Machines, wether processing or not.
|
||||||
var/global/list/processing_machines = list() // TODO - Move into SSmachines
|
var/global/list/processing_machines = list() // TODO - Move into SSmachines
|
||||||
var/global/list/processing_power_items = list() // TODO - Move into SSmachines
|
var/global/list/processing_power_items = list() // TODO - Move into SSmachines
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
gravity_is_on = !gravity_is_on
|
gravity_is_on = !gravity_is_on
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
A.gravitychange(gravity_is_on)
|
A.gravitychange(gravity_is_on)
|
||||||
|
|
||||||
feedback_inc("admin_secrets_fun_used",1)
|
feedback_inc("admin_secrets_fun_used",1)
|
||||||
|
|||||||
@@ -341,7 +341,7 @@
|
|||||||
var/list/areas_with_intercom = list()
|
var/list/areas_with_intercom = list()
|
||||||
var/list/areas_with_camera = 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))
|
if(!(A.type in areas_all))
|
||||||
areas_all.Add(A.type)
|
areas_all.Add(A.type)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
/datum/event/gravity/start()
|
/datum/event/gravity/start()
|
||||||
gravity_is_on = 0
|
gravity_is_on = 0
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
if(A.z in zLevels)
|
if(A.z in zLevels)
|
||||||
A.gravitychange(gravity_is_on)
|
A.gravitychange(gravity_is_on)
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
if(!gravity_is_on)
|
if(!gravity_is_on)
|
||||||
gravity_is_on = 1
|
gravity_is_on = 1
|
||||||
|
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
if(A.z in zLevels)
|
if(A.z in zLevels)
|
||||||
A.gravitychange(gravity_is_on)
|
A.gravitychange(gravity_is_on)
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/datum/event/prison_break/start()
|
/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))
|
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
|
||||||
areas += A
|
areas += A
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,12 @@
|
|||||||
Please stand by while the gravity system reinitializes.", "Gravity Failure")
|
Please stand by while the gravity system reinitializes.", "Gravity Failure")
|
||||||
|
|
||||||
/datum/event2/event/gravity/start()
|
/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())
|
if(A.z in get_location_z_levels())
|
||||||
A.gravitychange(FALSE)
|
A.gravitychange(FALSE)
|
||||||
|
|
||||||
/datum/event2/event/gravity/end()
|
/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())
|
if(A.z in get_location_z_levels())
|
||||||
A.gravitychange(TRUE)
|
A.gravitychange(TRUE)
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/datum/event2/event/prison_break/set_up()
|
/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))
|
if(is_type_in_list(A, area_types_to_break) && !is_type_in_list(A, area_types_to_ignore))
|
||||||
areas_to_break += A
|
areas_to_break += A
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Create lighting overlays on all turfs with dynamic lighting in areas with dynamic lighting.
|
// Create lighting overlays on all turfs with dynamic lighting in areas with dynamic lighting.
|
||||||
/proc/create_all_lighting_overlays()
|
/proc/create_all_lighting_overlays()
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
if(!A.dynamic_lighting)
|
if(!A.dynamic_lighting)
|
||||||
continue
|
continue
|
||||||
for(var/turf/T in A)
|
for(var/turf/T in A)
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ var/global/use_preloader = FALSE
|
|||||||
var/atom/instance
|
var/atom/instance
|
||||||
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
|
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
|
||||||
var/atype = members[index]
|
var/atype = members[index]
|
||||||
for(var/area/A in all_areas)
|
for(var/area/A in world)
|
||||||
if(A.type == atype)
|
if(A.type == atype)
|
||||||
instance = A
|
instance = A
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -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
|
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))
|
if((A.z in zs_to_test) && !(A.type in exempt_areas))
|
||||||
area_test_count++
|
area_test_count++
|
||||||
var/area_good = 1
|
var/area_good = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user