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
+3 -3
View File
@@ -110,11 +110,11 @@
/datum/async_input/ranked/render_choices()
var/dat = "<div>"
dat += "<table id='choices' uid=[UID()] style='margin: auto; text-align: left;'>"
for(var/i = 1, i <= choices.len, i++)
for(var/i = 1, i <= length(choices), i++)
var/choice = choices[i]
dat += "<tr>"
dat += "<td>[button("+", i != 1 ? "upvote=[i]" : "", null, i == 1)]</td>"
dat += "<td>[button("-", i != choices.len ? "downvote=[i]" : "", null, i == choices.len)]</td>"
dat += "<td>[button("-", i != length(choices) ? "downvote=[i]" : "", null, i == length(choices))]</td>"
dat += "<td style='cursor: move;' index='[i]' ondrop='drop(event)' ondragover='allowDrop(event)' draggable='true' ondragstart='drag(event)'>[i]. [choice]</td>"
dat += "</tr>"
dat += "</table>"
@@ -157,7 +157,7 @@
..()
popup.add_script("autocomplete.js", 'html/browser/autocomplete.js')
for(var/i=1, i <= choices.len, i++)
for(var/i=1, i <= length(choices), i++)
var/C = choices[choices[i]]
choices[i] = url_encode(choices[i], TRUE)
choices[choices[i]] = C
@@ -14,15 +14,15 @@
if(!holder) //don't want this without a holder
spawn
qdel(src)
set_desc(steps.len)
set_desc(length(steps))
return
/datum/construction/proc/next_step(mob/user as mob)
steps.len--
if(!steps.len)
if(!length(steps))
spawn_result(user)
else
set_desc(steps.len)
set_desc(length(steps))
return
/datum/construction/proc/action(atom/used_atom,mob/user as mob)
@@ -37,9 +37,9 @@
return 0
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
var/list/L = steps[steps.len]
var/list/L = steps[length(steps)]
if(do_tool_or_atom_check(used_atom, L["key"]))
return steps.len
return length(steps)
return 0
@@ -67,12 +67,12 @@
return 1
/datum/construction/proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
for(var/i=1;i<=length(steps);i++)
var/list/L = steps[i]
if(do_tool_or_atom_check(used_atom, L["key"]) && custom_action(i, used_atom, user))
steps[i]=null;//stupid byond list from list removal...
listclearnulls(steps)
if(!steps.len)
if(!length(steps))
spawn_result(user)
return 1
return 0
@@ -130,7 +130,7 @@
/datum/construction/reversible/New(atom)
..()
index = steps.len
index = length(steps)
return
/datum/construction/reversible/proc/update_index(diff as num, mob/user as mob)
+1 -1
View File
@@ -205,7 +205,7 @@
precision = rand(1, 100)
var/list/bagholding = teleatom.search_contents_for(/obj/item/storage/backpack/holding)
if(bagholding.len)
if(length(bagholding))
if(safe_turf_first) //If this is true, this is already a random teleport. Make it unsafe but do not touch the precision.
safe_turf_first = FALSE
else