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
+11 -11
View File
@@ -93,16 +93,16 @@
/obj/structure/beebox/process()
if(queen_bee)
if(bee_resources >= BEE_RESOURCE_HONEYCOMB_COST && honeycombs.len < get_max_honeycomb())
if(bee_resources >= BEE_RESOURCE_HONEYCOMB_COST && length(honeycombs) < get_max_honeycomb())
bee_resources = max(bee_resources-BEE_RESOURCE_HONEYCOMB_COST, 0)
var/obj/item/food/snacks/honeycomb/HC = new(src)
if(queen_bee.beegent)
HC.set_reagent(queen_bee.beegent.id)
honeycombs += HC
if(bees.len < get_max_bees())
if(length(bees) < get_max_bees())
var/freebee = FALSE //a freebee, geddit?, hahaha HAHAHAHA
if(bees.len <= 1) //there's always one set of worker bees, this isn't colony collapse disorder its 2d spessmen
if(length(bees) <= 1) //there's always one set of worker bees, this isn't colony collapse disorder its 2d spessmen
freebee = TRUE
if((bee_resources >= BEE_RESOURCE_NEW_BEE_COST && prob(BEE_PROB_NEW_BEE)) || freebee)
if(!freebee)
@@ -131,25 +131,25 @@
. += "<span class='warning'>There is no queen bee! There won't bee any honeycomb without a queen!</span>"
var/half_bee = get_max_bees()*0.5
if(half_bee && (bees.len >= half_bee))
if(half_bee && (length(bees) >= half_bee))
. += "<span class='notice'>This place is a BUZZ with activity... there are lots of bees!</span>"
. += "<span class='notice'>[bee_resources]/100 resource supply.</span>"
. += "<span class='notice'>[bee_resources]% towards a new honeycomb.</span>"
. += "<span class='notice'>[bee_resources*2]% towards a new bee.</span>"
if(honeycombs.len)
var/plural = honeycombs.len > 1
. += "<span class='notice'>There [plural? "are" : "is"] [honeycombs.len] uncollected honeycomb[plural ? "s":""] in the apiary.</span>"
if(length(honeycombs))
var/plural = length(honeycombs) > 1
. += "<span class='notice'>There [plural? "are" : "is"] [length(honeycombs)] uncollected honeycomb[plural ? "s":""] in the apiary.</span>"
if(honeycombs.len >= get_max_honeycomb())
if(length(honeycombs) >= get_max_honeycomb())
. += "<span class='warning'>there's no room for more honeycomb!</span>"
/obj/structure/beebox/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/honey_frame))
var/obj/item/honey_frame/HF = I
if(honey_frames.len < BEEBOX_MAX_FRAMES)
if(length(honey_frames) < BEEBOX_MAX_FRAMES)
if(!user.unEquip(HF))
return
visible_message("<span class='notice'>[user] adds a frame to the apiary.</span>")
@@ -227,7 +227,7 @@
return
switch(option)
if("Remove a Honey Frame")
if(!honey_frames.len)
if(!length(honey_frames))
to_chat(user, "<span class='warning'>There are no honey frames to remove!</span>")
return
@@ -239,7 +239,7 @@
var/amtH = HF.honeycomb_capacity
var/fallen = 0
while(honeycombs.len && amtH) //let's pretend you always grab the frame with the most honeycomb on it
while(length(honeycombs) && amtH) //let's pretend you always grab the frame with the most honeycomb on it
var/obj/item/food/snacks/honeycomb/HC = pick_n_take(honeycombs)
if(HC)
HC.forceMove(get_turf(src))
+3 -3
View File
@@ -55,7 +55,7 @@
for(var/datum/spacevine_mutation/SM in mutations)
if(initial(SM.quality) == SPACEVINE_MUTATION_NEGATIVE)
temp_mut_list += SM
if(prob(20) && temp_mut_list.len)
if(prob(20) && length(temp_mut_list))
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()
@@ -63,7 +63,7 @@
for(var/datum/spacevine_mutation/SM in mutations)
if(initial(SM.quality) == SPACEVINE_MUTATION_POSITIVE)
temp_mut_list += SM
if(prob(20) && temp_mut_list.len)
if(prob(20) && length(temp_mut_list))
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()
@@ -71,7 +71,7 @@
for(var/datum/spacevine_mutation/SM in mutations)
if(initial(SM.quality) == SPACEVINE_MUTATION_MINOR_NEGATIVE)
temp_mut_list += SM
if(prob(20) && temp_mut_list.len)
if(prob(20) && length(temp_mut_list))
mutations.Remove(pick(temp_mut_list))
temp_mut_list.Cut()