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
+15 -15
View File
@@ -173,9 +173,9 @@
SSshuttle.stationary += src
if(!id)
id = "[SSshuttle.stationary.len]"
id = "[length(SSshuttle.stationary)]"
if(name == "dock")
name = "dock[SSshuttle.stationary.len]"
name = "dock[length(SSshuttle.stationary)]"
#ifdef DOCKING_PORT_HIGHLIGHT
highlight("#f00")
@@ -254,7 +254,7 @@
register()
shuttle_areas = list()
var/list/all_turfs = return_ordered_turfs(x, y, z, dir)
for(var/i in 1 to all_turfs.len)
for(var/i in 1 to length(all_turfs))
var/turf/curT = all_turfs[i]
var/area/cur_area = curT.loc
if(istype(cur_area, areaInstance))
@@ -267,9 +267,9 @@
SSshuttle.mobile += src
if(!id)
id = "[SSshuttle.mobile.len]"
id = "[length(SSshuttle.mobile)]"
if(name == "shuttle")
name = "shuttle[SSshuttle.mobile.len]"
name = "shuttle[length(SSshuttle.mobile)]"
return 1
@@ -393,7 +393,7 @@
var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance)
//remove area surrounding docking port
if(areaInstance.contents.len)
if(length(areaInstance.contents))
var/area/A0 = locate("[area_type]")
if(!A0)
A0 = new area_type(null)
@@ -414,7 +414,7 @@
ripples += new /obj/effect/temp_visual/ripple(i)
/obj/docking_port/mobile/proc/remove_ripples()
if(ripples.len)
if(length(ripples))
for(var/i in ripples)
qdel(i)
ripples.Cut()
@@ -426,7 +426,7 @@
var/list/ripple_turfs = list()
for(var/i in 1 to L0.len)
for(var/i in 1 to length(L0))
var/turf/T0 = L0[i]
if(!T0)
continue
@@ -474,7 +474,7 @@
rotation = SIMPLIFY_DEGREES(rotation)
//remove area surrounding docking port
if(areaInstance.contents.len)
if(length(areaInstance.contents))
var/area/A0 = locate("[area_type]")
if(!A0)
A0 = new area_type(null)
@@ -487,7 +487,7 @@
//move or squish anything in the way ship at destination
roadkill(L0, L1, S1.dir)
for(var/i in 1 to L0.len)
for(var/i in 1 to length(L0))
var/turf/T0 = L0[i]
if(!T0)
continue
@@ -610,7 +610,7 @@
A.unlock()
/obj/docking_port/mobile/proc/roadkill(list/L0, list/L1, dir)
for(var/i in 1 to L0.len)
for(var/i in 1 to length(L0))
var/turf/T0 = L0[i]
var/turf/T1 = L1[i]
if(!T0 || !T1)
@@ -667,7 +667,7 @@
destination = null
/obj/docking_port/mobile/proc/check_effects()
if(!ripples.len)
if(!length(ripples))
if((mode == SHUTTLE_CALL) || (mode == SHUTTLE_RECALL))
var/tl = timeLeft(1)
if(tl <= SHUTTLE_RIPPLE_TIME)
@@ -835,7 +835,7 @@
if(!M.check_dock(S))
continue
docking_ports[++docking_ports.len] = list("name" = S.name, "id" = S.id)
data["docking_ports_len"] = docking_ports.len
data["docking_ports_len"] = length(docking_ports)
data["admin_controlled"] = admin_controlled
return data
@@ -989,11 +989,11 @@
/turf/proc/copyTurf(turf/T)
if(T.type != type)
var/obj/O
if(underlays.len) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
if(length(underlays)) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
O = new()
O.underlays.Add(T)
T.ChangeTurf(type, keep_icon = FALSE)
if(underlays.len)
if(length(underlays))
T.underlays = O.underlays
if(T.icon_state != icon_state)
T.icon_state = icon_state