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
+10 -10
View File
@@ -107,7 +107,7 @@
.["toolsother"][I] += 1
/datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
if(!R.tools.len) //does not run if no tools are needed
if(!length(R.tools)) //does not run if no tools are needed
return TRUE
var/list/possible_tools = list()
var/list/tools_used = list()
@@ -133,7 +133,7 @@
return TRUE
/datum/personal_crafting/proc/check_pathtools(mob/user, datum/crafting_recipe/R, list/contents)
if(!R.pathtools.len) //does not run if no tools are needed
if(!length(R.pathtools)) //does not run if no tools are needed
return TRUE
var/list/other_possible_tools = list()
for(var/obj/item/I in user.contents) // searchs the inventory of the mob
@@ -384,34 +384,34 @@
/datum/personal_crafting/proc/next_cat(readonly = TRUE)
if(!readonly)
viewing_subcategory = 1
. = viewing_category % categories.len + 1
. = viewing_category % length(categories) + 1
/datum/personal_crafting/proc/next_subcat()
if(islist(subcategories[viewing_category]))
var/list/subs = subcategories[viewing_category]
. = viewing_subcategory % subs.len + 1
. = viewing_subcategory % length(subs) + 1
//Previous can go fuck itself
/datum/personal_crafting/proc/prev_cat(readonly = TRUE)
if(!readonly)
viewing_subcategory = 1
if(viewing_category == categories.len)
if(viewing_category == length(categories))
. = viewing_category-1
else
. = viewing_category % categories.len - 1
. = viewing_category % length(categories) - 1
if(. <= 0)
. = categories.len
. = length(categories)
/datum/personal_crafting/proc/prev_subcat()
if(islist(subcategories[viewing_category]))
var/list/subs = subcategories[viewing_category]
if(viewing_subcategory == subs.len)
if(viewing_subcategory == length(subs))
. = viewing_subcategory-1
else
. = viewing_subcategory % subs.len - 1
. = viewing_subcategory % length(subs) - 1
if(. <= 0)
. = subs.len
. = length(subs)
else
. = null