diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 15d0f4ffd34..ccf2119b24e 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -533,10 +533,10 @@ About the new airlock wires panel:
src.electrified_until = 0
else if(duration) //electrify door for the given duration seconds
if(usr)
- shockedby += text("\[[time_stamp()]\] - [usr](ckey:[usr.ckey])")
+ LAZYADD(shockedby, "\[[time_stamp()]\] - [usr](ckey:[usr.ckey])")
usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]")
else
- shockedby += text("\[[time_stamp()]\] - EMP)")
+ LAZYADD(shockedby, "\[[time_stamp()]\] - EMP)")
message = "The door is now electrified [duration == -1 ? "permanently" : "for [duration] second\s"]."
src.electrified_until = duration == -1 ? -1 : world.time + SecondsToTicks(duration)
if (electrified_until > 0)
@@ -593,6 +593,7 @@ About the new airlock wires panel:
if (QDELING(src))
return
cut_overlays()
+ var/list/new_overlays = list()
if(density)
if(locked && lights && src.arePowerSystemsOn())
icon_state = "door_locked"
@@ -606,23 +607,23 @@ About the new airlock wires panel:
has_set_boltlight = FALSE
if(p_open || welded)
if(p_open)
- add_overlay("panel_open")
+ new_overlays += "panel_open"
if (!(stat & NOPOWER))
if(stat & BROKEN)
- add_overlay("sparks_broken")
+ new_overlays += "sparks_broken"
else if (health < maxhealth * 3/4)
- add_overlay("sparks_damaged")
+ new_overlays += "sparks_damaged"
if(welded)
- add_overlay("welded")
+ new_overlays += "welded"
else if (health < maxhealth * 3/4 && !(stat & NOPOWER))
- add_overlay("sparks_damaged")
+ new_overlays += "sparks_damaged"
if (hatch_image)
if (hatchstate)
hatch_image.icon_state = "[hatchstyle]_open"
else
hatch_image.icon_state = hatchstyle
- add_overlay(hatch_image)
+ new_overlays += hatch_image
else
if(p_open && panel_visible_while_open)
icon_state = "o_door_open"
@@ -635,7 +636,7 @@ About the new airlock wires panel:
set_light(0)
has_set_boltlight = FALSE
- update_above()
+ add_overlay(new_overlays)
/obj/machinery/door/airlock/do_animate(animation)
switch(animation)
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 9f55c7a6c25..3d9d02404fe 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -4,7 +4,7 @@
/obj/machinery/door/airlock
var/id_tag
var/frequency
- var/tmp/shockedby = list()
+ var/tmp/shockedby
var/tmp/datum/radio_frequency/radio_connection
var/tmp/cur_command = null //the command the door is currently attempting to complete
var/tmp/waiting_for_roundstart
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 61288d64a92..351ec454815 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -375,7 +375,7 @@ var/list/global/slot_flags_enumeration = list(
H << "You need a jumpsuit before you can attach this [name]."
return 0
var/obj/item/clothing/under/uniform = H.w_uniform
- if(uniform.accessories.len && !uniform.can_attach_accessory(src))
+ if(LAZYLEN(uniform.accessories) && !uniform.can_attach_accessory(src))
if (!disable_warning)
H << "You already have an accessory of this type attached to your [uniform]."
return 0
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 63609cda145..f636ec8d72e 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -6,7 +6,7 @@
var/list/species_restricted = null //Only these species can wear this kit.
var/gunshot_residue //Used by forensics.
- var/list/accessories = list()
+ var/list/accessories
var/list/valid_accessory_slots
var/list/restricted_accessory_slots
@@ -537,7 +537,7 @@ BLIND // can't see anything
/obj/item/clothing/under/attack_hand(var/mob/user)
- if(accessories && accessories.len)
+ if(LAZYLEN(accessories))
..()
if ((ishuman(usr) || issmall(usr)) && src.loc == user)
return
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 66a19b28e8d..70986ebcde9 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -3,7 +3,7 @@
.=1
else
return 0
- if(accessories.len && restricted_accessory_slots && (A.slot in restricted_accessory_slots))
+ if(LAZYLEN(accessories) && restricted_accessory_slots && (A.slot in restricted_accessory_slots))
for(var/obj/item/clothing/accessory/AC in accessories)
if (AC.slot == A.slot)
return 0
@@ -24,7 +24,7 @@
user << "You cannot attach more accessories of this type to [src]."
return
- if(accessories.len)
+ if(LAZYLEN(accessories))
for(var/obj/item/clothing/accessory/A in accessories)
A.attackby(I, user)
return
@@ -33,7 +33,7 @@
/obj/item/clothing/attack_hand(var/mob/user)
//only forward to the attached accessory if the clothing is equipped (not in a storage)
- if(accessories.len && src.loc == user)
+ if(LAZYLEN(accessories) && src.loc == user)
for(var/obj/item/clothing/accessory/A in accessories)
A.attack_hand(user)
return
@@ -60,12 +60,12 @@
/obj/item/clothing/examine(var/mob/user)
..(user)
- if(accessories.len)
+ if(LAZYLEN(accessories))
for(var/obj/item/clothing/accessory/A in accessories)
user << "\A [A] is attached to it."
/obj/item/clothing/proc/attach_accessory(mob/user, obj/item/clothing/accessory/A)
- accessories += A
+ LAZYADD(accessories, A)
A.on_attached(src, user)
src.verbs |= /obj/item/clothing/proc/removetie_verb
update_clothing_icon()
@@ -75,7 +75,7 @@
return
A.on_removed(user)
- accessories -= A
+ LAZYREMOVE(accessories, A)
update_clothing_icon()
/obj/item/clothing/proc/removetie_verb()
@@ -84,18 +84,18 @@
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
- if(!accessories.len) return
+ if(!LAZYLEN(accessories)) return
var/obj/item/clothing/accessory/A
- if(accessories.len > 1)
+ if(LAZYLEN(accessories) > 1)
A = input("Select an accessory to remove from [src]") as null|anything in accessories
else
A = accessories[1]
src.remove_accessory(usr,A)
- if(!accessories.len)
+ if(!LAZYLEN(accessories))
src.verbs -= /obj/item/clothing/proc/removetie_verb
/obj/item/clothing/emp_act(severity)
- if(accessories.len)
+ if(LAZYLEN(accessories))
for(var/obj/item/clothing/accessory/A in accessories)
A.emp_act(severity)
..()
diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm
index d6b5cbd73f7..766f05654e9 100644
--- a/code/modules/clothing/under/accessories/holster.dm
+++ b/code/modules/clothing/under/accessories/holster.dm
@@ -96,7 +96,7 @@
H = src
else if (istype(src, /obj/item/clothing/under))
var/obj/item/clothing/under/S = src
- if (S.accessories.len)
+ if (LAZYLEN(S.accessories))
H = locate() in S.accessories
else if (istype(src, /obj/item/clothing/suit/armor/tactical)) // This armor is a snowflake and has an integrated holster.
var/obj/item/clothing/suit/armor/tactical/tacticool = src
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 34403e6067f..3916a853b0e 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -52,7 +52,7 @@
var/tie_msg
if(istype(w_uniform,/obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
- if(U.accessories.len)
+ if(LAZYLEN(U.accessories))
tie_msg += ". Attached to it is [lowertext(english_list(U.accessories))]"
if(w_uniform.blood_DNA)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index b8e6de277ab..26df595708b 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -298,7 +298,7 @@
if(legcuffed)
dat += "
Legcuffed"
- if(suit && suit.accessories.len)
+ if(suit && LAZYLEN(suit.accessories))
dat += "
Remove accessory"
dat += "
Remove splints"
dat += "
Empty pockets"
diff --git a/code/modules/mob/living/carbon/human/stripping.dm b/code/modules/mob/living/carbon/human/stripping.dm
index 5606530b88b..e275de31878 100644
--- a/code/modules/mob/living/carbon/human/stripping.dm
+++ b/code/modules/mob/living/carbon/human/stripping.dm
@@ -33,7 +33,7 @@
return 1
if("tie")
var/obj/item/clothing/under/suit = w_uniform
- if(!istype(suit) || !suit.accessories.len)
+ if(!istype(suit) || !LAZYLEN(suit.accessories))
return 0
var/obj/item/clothing/accessory/A = suit.accessories[1]
if(!istype(A))
@@ -50,9 +50,7 @@
user.visible_message("\The [user] tears off \the [A] from [src]'s [suit.name]!")
attack_log += "\[[time_stamp()]\] Has had \the [A] removed by [user.name] ([user.ckey])"
user.attack_log += "\[[time_stamp()]\] Attempted to remove [name]'s ([ckey]) [A.name]"
- A.on_removed(user)
- suit.accessories -= A
- update_inv_w_uniform()
+ suit.remove_accessory(user, A)
return 1
// Are we placing or stripping?
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index ebe84ee1513..e8ab1e5b935 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -535,7 +535,7 @@ There are several things that need to be remembered:
//accessories
if (istype(w_uniform, /obj/item/clothing/under))//Prevent runtime errors with unusual objects
var/obj/item/clothing/under/under = w_uniform
- if(under.accessories.len)
+ if(LAZYLEN(under.accessories))
if (!ovr)
ovr = list(standing)
@@ -871,9 +871,10 @@ There are several things that need to be remembered:
// Accessories - copied from uniform, BOILERPLATE because fuck this system.
var/obj/item/clothing/suit/suit = wear_suit
- if(istype(suit) && suit.accessories.len)
+ if(istype(suit) && LAZYLEN(suit.accessories))
if (!ovr)
ovr = list(standing)
+
for(var/obj/item/clothing/accessory/A in suit.accessories)
ovr += A.get_mob_overlay()