mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 03:26:37 +01:00
Reduce Lists Memory usage, update CI (#17706)
* Convert alerts to a lazylist * Convert fullscreens to lazylist * Convert ckeys_allowed_itemspawn to a lazylist * Convert camera lists to lazylists * Get rid of an old unused footstep_sounds list * Make flooring_cache a lazy list * Fix flooring_blacklist, convert a bunch more flooring lists to lazylists * Improve ci byond caching
This commit is contained in:
@@ -38,15 +38,13 @@
|
||||
|
||||
var/affected_by_emp_until = 0
|
||||
|
||||
var/client_huds = list()
|
||||
|
||||
var/list/camera_computers_using_this = list()
|
||||
var/client_huds = null
|
||||
|
||||
/obj/machinery/camera/Initialize(mapload)
|
||||
wires = new(src)
|
||||
assembly = new(src)
|
||||
assembly.state = 4
|
||||
client_huds |= GLOB.global_hud.whitense
|
||||
LAZYOR(client_huds, GLOB.global_hud.whitense)
|
||||
|
||||
/* // Use this to look for cameras that have the same c_tag.
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/camera
|
||||
var/list/motionTargets = list()
|
||||
var/list/motionTargets = null
|
||||
var/detectTime = 0
|
||||
var/area/ai_monitored/area_motion = null
|
||||
var/alarm_delay = 100 // Don't forget, there's another 10 seconds in queueAlarm()
|
||||
@@ -29,13 +29,13 @@
|
||||
if (detectTime == 0)
|
||||
detectTime = world.time // start the clock
|
||||
if (!(target in motionTargets))
|
||||
motionTargets += target
|
||||
LAZYADD(motionTargets, target)
|
||||
return 1
|
||||
|
||||
/obj/machinery/camera/proc/lostTarget(var/mob/target)
|
||||
if (target in motionTargets)
|
||||
motionTargets -= target
|
||||
if (motionTargets.len == 0)
|
||||
LAZYREMOVE(motionTargets, target)
|
||||
if (LAZYLEN(motionTargets) == 0)
|
||||
cancelAlarm()
|
||||
|
||||
/obj/machinery/camera/proc/cancelAlarm()
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
var/climbing_delay = 1 //If rock_climbing, lower better.
|
||||
var/digestable = TRUE
|
||||
var/item_tf_spawn_allowed = FALSE
|
||||
var/list/ckeys_allowed_itemspawn = list()
|
||||
var/list/ckeys_allowed_itemspawn = null
|
||||
|
||||
/obj/item/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -49,16 +49,6 @@
|
||||
if(!T)
|
||||
return PROXIMITY_OFF_CAMERANET
|
||||
|
||||
// Security is also a concern, so we need to see if any cameras are in use.
|
||||
// Note that this will trigger upon the security console being used, regardless if someone is actually watching,
|
||||
// because there isn't a nice way to test if someone is actually looking. Probably better that way too.
|
||||
var/list/our_local_area = range(range_alert, T)
|
||||
for(var/obj/machinery/camera/C in our_local_area)
|
||||
if(C.camera_computers_using_this.len) // Only check cameras actively being used.
|
||||
var/list/their_local_area = C.can_see(range_alert)
|
||||
if(T in their_local_area)
|
||||
return PROXIMITY_ON_SCREEN
|
||||
|
||||
// Now for the somewhat harder AI cameranet checks.
|
||||
|
||||
// Check if we are even on the cameranet.
|
||||
|
||||
@@ -351,8 +351,8 @@ var/global/list/obj/item/communicator/all_communicators = list() //Don't change
|
||||
|
||||
/obj/machinery/camera/communicator/Initialize(mapload)
|
||||
. = ..()
|
||||
client_huds |= GLOB.global_hud.whitense
|
||||
client_huds |= GLOB.global_hud.darkMask
|
||||
LAZYOR(client_huds, GLOB.global_hud.whitense)
|
||||
LAZYOR(client_huds, GLOB.global_hud.darkMask)
|
||||
|
||||
//It's the 26th century. We should have smart watches by now.
|
||||
/obj/item/communicator/watch
|
||||
|
||||
@@ -44,10 +44,8 @@ var/list/flooring_types
|
||||
var/flags
|
||||
var/can_paint
|
||||
var/can_engrave = FALSE
|
||||
var/list/footstep_sounds = list() // key=species name, value = list of sounds,
|
||||
// For instance, footstep_sounds = list("key" = list(sound.ogg))
|
||||
var/is_plating = FALSE
|
||||
var/list/flooring_cache = list() // Cached overlays for our edges and corners and junk
|
||||
var/list/flooring_cache = null // Cached overlays for our edges and corners and junk
|
||||
|
||||
//Plating types, can be overridden
|
||||
var/plating_type = null
|
||||
@@ -73,8 +71,8 @@ var/list/flooring_types
|
||||
|
||||
//How we smooth with other flooring
|
||||
var/floor_smooth = SMOOTH_NONE
|
||||
var/list/flooring_whitelist = list() //Smooth with nothing except the contents of this list
|
||||
var/list/flooring_blacklist = list() //Smooth with everything except the contents of this list
|
||||
var/list/flooring_whitelist = null //Smooth with nothing except the contents of this list
|
||||
var/list/flooring_blacklist = null //Smooth with everything except the contents of this list
|
||||
|
||||
//How we smooth with walls
|
||||
var/wall_smooth = SMOOTH_NONE
|
||||
@@ -112,8 +110,8 @@ var/list/flooring_types
|
||||
|
||||
*/
|
||||
var/smooth_movable_atom = SMOOTH_NONE
|
||||
var/list/movable_atom_whitelist = list()
|
||||
var/list/movable_atom_blacklist = list()
|
||||
var/list/movable_atom_whitelist = null
|
||||
var/list/movable_atom_blacklist = null
|
||||
|
||||
var/check_season = FALSE //VOREStation Addition
|
||||
|
||||
@@ -121,11 +119,11 @@ var/list/flooring_types
|
||||
return plating_type
|
||||
|
||||
/decl/flooring/proc/get_flooring_overlay(var/cache_key, var/icon_base, var/icon_dir = 0, var/layer = BUILTIN_DECAL_LAYER)
|
||||
if(!flooring_cache[cache_key])
|
||||
if(!LAZYACCESS(flooring_cache, cache_key))
|
||||
var/image/I = image(icon = icon, icon_state = icon_base, dir = icon_dir)
|
||||
I.layer = layer
|
||||
flooring_cache[cache_key] = I
|
||||
return flooring_cache[cache_key]
|
||||
LAZYSET(flooring_cache, cache_key, I)
|
||||
return LAZYACCESS(flooring_cache, cache_key)
|
||||
|
||||
/decl/flooring/grass
|
||||
name = "grass"
|
||||
@@ -136,11 +134,6 @@ var/list/flooring_types
|
||||
damage_temperature = T0C+80
|
||||
flags = TURF_HAS_EDGES | TURF_HAS_CORNERS | TURF_REMOVE_SHOVEL
|
||||
build_type = /obj/item/stack/tile/grass
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/grass1.ogg',
|
||||
'sound/effects/footstep/grass2.ogg',
|
||||
'sound/effects/footstep/grass3.ogg',
|
||||
'sound/effects/footstep/grass4.ogg'))
|
||||
|
||||
/decl/flooring/grass/sif // Subtype for Sif's grass.
|
||||
name = "growth"
|
||||
@@ -164,22 +157,12 @@ var/list/flooring_types
|
||||
desc = "Water is wet, gosh, who knew!"
|
||||
icon = 'icons/turf/outdoors.dmi'
|
||||
icon_base = "seashallow"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/water1.ogg',
|
||||
'sound/effects/footstep/water2.ogg',
|
||||
'sound/effects/footstep/water3.ogg',
|
||||
'sound/effects/footstep/water4.ogg'))
|
||||
|
||||
/decl/flooring/sand
|
||||
name = "sand"
|
||||
desc = "I don't like sand. It's coarse and rough and irritating and it gets everywhere."
|
||||
icon = 'icons/misc/beach.dmi'
|
||||
icon_base = "sand"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/HeavySand1.ogg',
|
||||
'sound/effects/footstep/HeavySand2.ogg',
|
||||
'sound/effects/footstep/HeavySand3.ogg',
|
||||
'sound/effects/footstep/HeavySand4.ogg'))
|
||||
|
||||
/decl/flooring/sand/desert // Subtype of sand, desert.
|
||||
name = "desert"
|
||||
@@ -192,22 +175,12 @@ var/list/flooring_types
|
||||
desc = "Wet and fragrant mud, bane of the freshly mopped floor."
|
||||
icon = 'icons/turf/outdoors.dmi'
|
||||
icon_base = "mud_dark"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/mud1.ogg',
|
||||
'sound/effects/footstep/mud2.ogg',
|
||||
'sound/effects/footstep/mud3.ogg',
|
||||
'sound/effects/footstep/mud4.ogg'))
|
||||
|
||||
/decl/flooring/rock
|
||||
name = "rocks"
|
||||
desc = "Hard as a rock."
|
||||
icon = 'icons/turf/outdoors.dmi'
|
||||
icon_base = "rock"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/LightStone1.ogg',
|
||||
'sound/effects/footstep/LightStone2.ogg',
|
||||
'sound/effects/footstep/LightStone3.ogg',
|
||||
'sound/effects/footstep/LightStone4.ogg'))
|
||||
|
||||
/decl/flooring/asteroid
|
||||
name = "coarse sand"
|
||||
@@ -216,12 +189,6 @@ var/list/flooring_types
|
||||
icon_base = "asteroid"
|
||||
flags = TURF_REMOVE_SHOVEL | TURF_ACID_IMMUNE
|
||||
build_type = null
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/asteroid1.ogg',
|
||||
'sound/effects/footstep/asteroid2.ogg',
|
||||
'sound/effects/footstep/asteroid3.ogg',
|
||||
'sound/effects/footstep/asteroid4.ogg',
|
||||
'sound/effects/footstep/asteroid5.ogg'))
|
||||
|
||||
/decl/flooring/dirt
|
||||
name = "soil"
|
||||
@@ -230,28 +197,12 @@ var/list/flooring_types
|
||||
icon_base = "dirt-dark"
|
||||
flags = TURF_REMOVE_SHOVEL
|
||||
build_type = null
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/asteroid1.ogg',
|
||||
'sound/effects/footstep/asteroid2.ogg',
|
||||
'sound/effects/footstep/asteroid3.ogg',
|
||||
'sound/effects/footstep/asteroid4.ogg',
|
||||
'sound/effects/footstep/asteroid5.ogg',
|
||||
'sound/effects/footstep/MedDirt1.ogg',
|
||||
'sound/effects/footstep/MedDirt2.ogg',
|
||||
'sound/effects/footstep/MedDirt3.ogg',
|
||||
'sound/effects/footstep/MedDirt4.ogg',))
|
||||
|
||||
/decl/flooring/snow
|
||||
name = "snow"
|
||||
desc = "A layer of many tiny bits of frozen water. It's hard to tell how deep it is."
|
||||
icon = 'icons/turf/outdoors.dmi'
|
||||
icon_base = "snow"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/snow1.ogg',
|
||||
'sound/effects/footstep/snow2.ogg',
|
||||
'sound/effects/footstep/snow3.ogg',
|
||||
'sound/effects/footstep/snow4.ogg',
|
||||
'sound/effects/footstep/snow5.ogg'))
|
||||
|
||||
/decl/flooring/snow/fake
|
||||
desc = "A coating of fake snow, looks surprisingly realistic, though not as cold as the real thing."
|
||||
@@ -292,12 +243,6 @@ var/list/flooring_types
|
||||
build_type = /obj/item/stack/tile/carpet
|
||||
damage_temperature = T0C+200
|
||||
flags = TURF_HAS_EDGES | TURF_HAS_CORNERS | TURF_REMOVE_CROWBAR | TURF_CAN_BURN
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/carpet1.ogg',
|
||||
'sound/effects/footstep/carpet2.ogg',
|
||||
'sound/effects/footstep/carpet3.ogg',
|
||||
'sound/effects/footstep/carpet4.ogg',
|
||||
'sound/effects/footstep/carpet5.ogg'))
|
||||
|
||||
/decl/flooring/carpet/bcarpet
|
||||
name = "black carpet"
|
||||
@@ -394,12 +339,6 @@ var/list/flooring_types
|
||||
build_type = /obj/item/stack/tile/floor
|
||||
can_paint = 1
|
||||
can_engrave = TRUE
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/floor1.ogg',
|
||||
'sound/effects/footstep/floor2.ogg',
|
||||
'sound/effects/footstep/floor3.ogg',
|
||||
'sound/effects/footstep/floor4.ogg',
|
||||
'sound/effects/footstep/floor5.ogg'))
|
||||
|
||||
/decl/flooring/tiling/tech
|
||||
desc = "Metal floor tiles with a corrugated anti-slip texture."
|
||||
@@ -537,12 +476,6 @@ var/list/flooring_types
|
||||
descriptor = "planks"
|
||||
build_type = /obj/item/stack/tile/wood
|
||||
flags = TURF_CAN_BREAK | TURF_REMOVE_CROWBAR | TURF_REMOVE_SCREWDRIVER
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/wood1.ogg',
|
||||
'sound/effects/footstep/wood2.ogg',
|
||||
'sound/effects/footstep/wood3.ogg',
|
||||
'sound/effects/footstep/wood4.ogg',
|
||||
'sound/effects/footstep/wood5.ogg'))
|
||||
|
||||
/decl/flooring/wood/sif
|
||||
desc = "Polished wood planks made from sivian wood."
|
||||
@@ -587,12 +520,6 @@ var/list/flooring_types
|
||||
apply_thermal_conductivity = 0.025
|
||||
apply_heat_capacity = 325000
|
||||
can_paint = 1
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/hull1.ogg',
|
||||
'sound/effects/footstep/hull2.ogg',
|
||||
'sound/effects/footstep/hull3.ogg',
|
||||
'sound/effects/footstep/hull4.ogg',
|
||||
'sound/effects/footstep/hull5.ogg'))
|
||||
|
||||
/decl/flooring/reinforced/circuit
|
||||
name = "processing strata"
|
||||
@@ -623,10 +550,6 @@ var/list/flooring_types
|
||||
icon_base = "lava"
|
||||
is_plating = TRUE
|
||||
flags = TURF_ACID_IMMUNE
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/lava1.ogg',
|
||||
'sound/effects/footstep/lava2.ogg',
|
||||
'sound/effects/footstep/lava3.ogg'))
|
||||
|
||||
/decl/flooring/concrete
|
||||
name = "concrete"
|
||||
|
||||
@@ -17,12 +17,6 @@
|
||||
desc = "This slick flesh ripples and squishes under your touch"
|
||||
icon = 'icons/turf/stomach_vr.dmi'
|
||||
icon_base = "flesh_floor"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/mud1.ogg',
|
||||
'sound/effects/footstep/mud2.ogg',
|
||||
'sound/effects/footstep/mud3.ogg',
|
||||
'sound/effects/footstep/mud4.ogg'
|
||||
))
|
||||
|
||||
/decl/flooring/grass/outdoors
|
||||
flags = 0
|
||||
@@ -80,12 +74,6 @@
|
||||
plating_type = /decl/flooring/eris_plating/under
|
||||
can_paint = 1
|
||||
can_engrave = TRUE
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/floor1.ogg',
|
||||
'sound/effects/footstep/floor2.ogg',
|
||||
'sound/effects/footstep/floor3.ogg',
|
||||
'sound/effects/footstep/floor4.ogg',
|
||||
'sound/effects/footstep/floor5.ogg'))
|
||||
|
||||
/turf/simulated/floor/tiled/milspec
|
||||
name = "milspec floor"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
var/list/flooring_cache = list()
|
||||
|
||||
var/image/no_ceiling_image = null
|
||||
|
||||
/hook/startup/proc/setup_no_ceiling_image()
|
||||
@@ -182,7 +180,7 @@ var/image/no_ceiling_image = null
|
||||
break
|
||||
else if(floor_smooth == SMOOTH_BLACKLIST)
|
||||
is_linked = TRUE //Default to true for the blacklist, then make it false if a match comes up
|
||||
for (var/v in flooring_whitelist)
|
||||
for (var/v in flooring_blacklist)
|
||||
if (istype(t.flooring, v))
|
||||
//Found a match on the list
|
||||
is_linked = FALSE
|
||||
@@ -278,10 +276,3 @@ var/image/no_ceiling_image = null
|
||||
is_linked = FALSE
|
||||
|
||||
return is_linked
|
||||
|
||||
/turf/simulated/floor/proc/get_flooring_overlay(var/cache_key, var/icon_base, var/icon_dir = 0)
|
||||
if(!flooring_cache[cache_key])
|
||||
var/image/I = image(icon = flooring.icon, icon_state = icon_base, dir = icon_dir)
|
||||
I.layer = layer
|
||||
flooring_cache[cache_key] = I
|
||||
return flooring_cache[cache_key]
|
||||
|
||||
@@ -1017,7 +1017,6 @@
|
||||
health = 100
|
||||
|
||||
floor_smooth = SMOOTH_BLACKLIST
|
||||
flooring_blacklist = list(/decl/flooring/reinforced/plating/under,/decl/flooring/reinforced/plating/hull) //Smooth with everything except the contents of this list
|
||||
smooth_movable_atom = SMOOTH_GREYLIST
|
||||
movable_atom_blacklist = list(list(/obj, list("density" = TRUE, "anchored" = TRUE), 1))
|
||||
movable_atom_whitelist = list(list(/obj/machinery/door/airlock, list(), 2))
|
||||
|
||||
@@ -11,16 +11,6 @@
|
||||
desc = "Red and gritty."
|
||||
icon = 'icons/turf/flooring/ironsand_vr.dmi'
|
||||
icon_base = "ironsand1"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/asteroid1.ogg',
|
||||
'sound/effects/footstep/asteroid2.ogg',
|
||||
'sound/effects/footstep/asteroid3.ogg',
|
||||
'sound/effects/footstep/asteroid4.ogg',
|
||||
'sound/effects/footstep/asteroid5.ogg',
|
||||
'sound/effects/footstep/MedDirt1.ogg',
|
||||
'sound/effects/footstep/MedDirt2.ogg',
|
||||
'sound/effects/footstep/MedDirt3.ogg',
|
||||
'sound/effects/footstep/MedDirt4.ogg'))
|
||||
|
||||
/turf/simulated/floor/outdoors/ironsand/Initialize(mapload)
|
||||
var/possiblesands = list(
|
||||
|
||||
@@ -66,7 +66,3 @@
|
||||
desc = "Deep Ocean Water"
|
||||
icon = 'icons/misc/beach.dmi'
|
||||
icon_base = "seadeep"
|
||||
footstep_sounds = list("human" = list(
|
||||
'sound/effects/footstep/bubbles3.ogg', // No I don't get why it's named 3/4/5 either. Whatever.
|
||||
'sound/effects/footstep/bubbles4.ogg',
|
||||
'sound/effects/footstep/bubbles5.ogg'))
|
||||
|
||||
Reference in New Issue
Block a user