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 19:32:09 +02:00
committed by GitHub
parent bdd417ada0
commit bad8b31afa
369 changed files with 1162 additions and 1163 deletions
+2 -2
View File
@@ -146,7 +146,7 @@
return TRUE
/obj/item/organ/internal/cyberimp/arm/ui_action_click()
if(crit_fail || (!holder && !contents.len))
if(crit_fail || (!holder && !length(contents)))
to_chat(owner, "<span class='warning'>The implant doesn't respond. It seems to be broken...</span>")
return
@@ -157,7 +157,7 @@
if(!holder || (holder in src))
holder = null
if(contents.len == 1)
if(length(contents) == 1)
Extend(contents[1])
else
radial_menu(owner)
+3 -3
View File
@@ -58,9 +58,9 @@
if(BP.is_robotic())
continue
//We want an accurate reading of .len
//We want an accurate reading of length()
listclearnulls(BP.embedded_objects)
temp_bleed += 0.5*BP.embedded_objects.len
temp_bleed += 0.5 * length(BP.embedded_objects)
if(brutedamage >= 20)
temp_bleed += (brutedamage * 0.013)
@@ -191,7 +191,7 @@
blood_data["viruses"] += D.Copy()
blood_data["blood_DNA"] = copytext(dna.unique_enzymes,1,0)
if(resistances && resistances.len)
if(resistances && length(resistances))
blood_data["resistances"] = resistances.Copy()
var/list/temp_chem = list()
for(var/datum/reagent/R in reagents.reagent_list)
@@ -254,7 +254,7 @@
// High brute damage or sharp objects may damage internal organs
if(internal_organs && (brute_dam >= max_limb_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB))))
// Damage an internal organ
if(internal_organs && internal_organs.len)
if(internal_organs && length(internal_organs))
var/obj/item/organ/internal/I = pick(internal_organs)
I.receive_damage(brute * 0.5)
@@ -304,9 +304,9 @@
for(var/organ in children)
if(organ)
possible_points += organ
if(forbidden_limbs.len)
if(length(forbidden_limbs))
possible_points -= forbidden_limbs
if(possible_points.len)
if(length(possible_points))
//And pass the pain around
var/obj/item/organ/external/target = pick(possible_points)
target.receive_damage(brute, burn, sharp, used_weapon, forbidden_limbs + src, ignore_resists = TRUE) //If the damage was reduced before, don't reduce it again
@@ -464,7 +464,7 @@ Note that amputating the affected organ does in fact remove the infection from t
for(var/obj/item/organ/internal/I in internal_organs)
if(I.germ_level < germ_level)
candidate_organs |= I
if(candidate_organs.len)
if(length(candidate_organs))
target_organ = pick(candidate_organs)
if(target_organ)
+1 -1
View File
@@ -5,7 +5,7 @@
child_icons.Cut()
// This is a kludge, only one icon has more than one generation of children though.
for(var/obj/item/organ/external/organ in contents)
if(organ.children && organ.children.len)
if(organ.children && length(organ.children))
for(var/obj/item/organ/external/child in organ.children)
overlays += child.mob_icon
child_icons += child.mob_icon
+3 -3
View File
@@ -168,7 +168,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby"))
continue
listeners += L
if(!listeners.len)
if(!length(listeners))
next_command = world.time + cooldown_none
return
@@ -209,9 +209,9 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby"))
//Cut out the job so it doesn't trigger commands
found_string = L.mind.assigned_role
if(specific_listeners.len)
if(length(specific_listeners))
listeners = specific_listeners
power_multiplier *= (1 + (1/specific_listeners.len)) //2x on a single guy, 1.5x on two and so on
power_multiplier *= (1 + (1/length(specific_listeners))) //2x on a single guy, 1.5x on two and so on
message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1)
//STUN