Changes all .len to length() where applicable (#25174)

* Globals work

* Double access works

* All other things

* Revert "All other things"

This reverts commit 6574442eb6.

* More changes that compile and work

* IT WORKS AAAAAA

* Changes even more .len to length()

* Apply suggestions from code review

* Update code/datums/mind.dm

* Update code/__HELPERS/sorts/InsertSort.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

* Update code/__HELPERS/sanitize_values.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

---------

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-04-19 17:32:09 +00:00
committed by GitHub
co-authored by Deniz FunnyMan3595
parent bdd417ada0
commit bad8b31afa
369 changed files with 1162 additions and 1163 deletions
@@ -77,7 +77,7 @@
return TOXLOSS
/obj/item/storage/bag/trash/update_icon_state()
switch(contents.len)
switch(length(contents))
if(21 to INFINITY)
icon_state = "[initial(icon_state)]3"
if(11 to 20)
@@ -336,7 +336,7 @@
// Sets up numbered display to show the stack size of each stored mineral
// NOTE: numbered display is turned off currently because it's broken
/obj/item/storage/bag/sheetsnatcher/orient2hud(mob/user as mob)
var/adjusted_contents = contents.len
var/adjusted_contents = length(contents)
//Numbered contents display
var/list/datum/numbered_display/numbered_contents
@@ -1005,7 +1005,7 @@
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
if(is_pen(W))
//if a pen is used on the sack, dialogue to change its design appears
if(contents.len)
if(length(contents))
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
return
var/list/designs = list(NODESIGN, NANOTRASEN, SYNDI, HEART, SMILE)
@@ -1022,7 +1022,7 @@
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
return
else if(W.sharp)
if(!contents.len)
if(!length(contents))
if(item_state == "paperbag_None")
to_chat(user, "<span class='notice'>You cut eyeholes into [src].</span>")
new /obj/item/clothing/head/papersack(user.loc)
@@ -232,15 +232,15 @@
new cigarette_type(src)
/obj/item/storage/fancy/cigarettes/update_icon_state()
icon_state = "[initial(icon_state)][contents.len]"
icon_state = "[initial(icon_state)][length(contents)]"
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
if(istype(M) && M == user && user.zone_selected == "mouth" && contents.len > 0 && !user.wear_mask)
if(istype(M) && M == user && user.zone_selected == "mouth" && length(contents) > 0 && !user.wear_mask)
var/got_cig = 0
for(var/num=1, num <= contents.len, num++)
for(var/num=1, num <= length(contents), num++)
var/obj/item/I = contents[num]
if(istype(I, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/C = I
@@ -374,7 +374,7 @@
/obj/item/storage/fancy/rollingpapers/update_overlays()
. = ..()
if(!contents.len)
if(!length(contents))
. += "[icon_state]_empty"
/*
@@ -290,7 +290,7 @@
overlays += I
/obj/item/storage/pill_bottle/attack(mob/M, mob/user)
if(iscarbon(M) && contents.len)
if(iscarbon(M) && length(contents))
if(applying_meds)
to_chat(user, "<span class='warning'>You are already applying meds.</span>")
return
@@ -339,7 +339,7 @@
if(iscarbon(over_object))
var/mob/living/carbon/C = over_object
if(loc == C && src == C.get_active_hand())
if(!contents.len)
if(!length(contents))
to_chat(C, "<span class='notice'>There is nothing in [src]!</span>")
return
C.visible_message("<span class='danger'>[C] [rapid_intake_message]</span>")
@@ -722,7 +722,7 @@
// But then again a tesseract would destroy the server anyways
// Also I wish I could just insert a list instead of it reading it the wrong way
content_list.len++
content_list[content_list.len] = AM.serialize()
content_list[length(content_list)] = AM.serialize()
return data
/obj/item/storage/deserialize(list/data)
@@ -36,7 +36,7 @@
new /obj/item/stack/medical/ointment/advanced(src)
/obj/item/storage/surgical_tray/update_icon_state()
if(!contents.len)
if(!length(contents))
icon_state = "surgical_tray_e"
else
icon_state = "surgical_tray"