mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
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:
co-authored by
Deniz
FunnyMan3595
parent
bdd417ada0
commit
bad8b31afa
@@ -245,7 +245,7 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
if(is_being_smoked) // if it's being smoked, transfer reagents to the mob
|
||||
var/mob/living/carbon/C = loc
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
reagents.trans_id_to(C, R.id, first_puff ? 1 : max(REAGENTS_METABOLISM / reagents.reagent_list.len, 0.1)) //transfer at least .1 of each chem
|
||||
reagents.trans_id_to(C, R.id, first_puff ? 1 : max(REAGENTS_METABOLISM / length(reagents.reagent_list), 0.1)) //transfer at least .1 of each chem
|
||||
first_puff = FALSE
|
||||
if(!reagents.total_volume) // There were reagents, but now they're gone
|
||||
to_chat(C, "<span class='notice'>Your [name] loses its flavor.</span>")
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
to_chat(user, "You remove the label from [src].")
|
||||
return 1
|
||||
else if(stage == WIRED && is_type_in_list(I, allowed_containers))
|
||||
if(beakers.len == 2)
|
||||
if(length(beakers) == 2)
|
||||
to_chat(user, "<span class='notice'>[src] can not hold more containers.</span>")
|
||||
return
|
||||
else
|
||||
@@ -184,7 +184,7 @@
|
||||
nadeassembly.forceMove(get_turf(src))
|
||||
nadeassembly.master = null
|
||||
nadeassembly = null
|
||||
if(beakers.len)
|
||||
if(length(beakers))
|
||||
for(var/obj/O in beakers)
|
||||
O.forceMove(get_turf(src))
|
||||
beakers = list()
|
||||
@@ -280,7 +280,7 @@
|
||||
|
||||
if(!chem_splash(get_turf(src), affected_area, reactants, ignition_temp, threatscale) && !no_splash)
|
||||
playsound(loc, 'sound/items/screwdriver2.ogg', 50, 1)
|
||||
if(beakers.len)
|
||||
if(length(beakers))
|
||||
for(var/obj/O in beakers)
|
||||
O.forceMove(get_turf(src))
|
||||
beakers = list()
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
if(holocreator_busy)
|
||||
to_chat(user, "<span class='notice'>[src] is busy creating a hologram.</span>")
|
||||
return
|
||||
if(signs.len < max_signs)
|
||||
if(length(signs) < max_signs)
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 20, 1)
|
||||
if(creation_time)
|
||||
holocreator_busy = TRUE
|
||||
@@ -40,7 +40,7 @@
|
||||
holocreator_busy = FALSE
|
||||
return
|
||||
holocreator_busy = FALSE
|
||||
if(signs.len >= max_signs)
|
||||
if(length(signs) >= max_signs)
|
||||
return
|
||||
if(is_blocked_turf(T, TRUE)) //don't try to sneak dense stuff on our tile during the wait.
|
||||
return
|
||||
@@ -54,7 +54,7 @@
|
||||
return
|
||||
|
||||
/obj/item/holosign_creator/attack_self(mob/user)
|
||||
if(signs.len)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, "<span class='notice'>You clear all active holograms.</span>")
|
||||
@@ -135,7 +135,7 @@
|
||||
to_chat(user, "<span class='notice'>You clear all active holograms, and reset your projector to normal.</span>")
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg
|
||||
creation_time = 5
|
||||
if(signs.len)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 0
|
||||
@@ -144,17 +144,17 @@
|
||||
to_chat(user, "<span class='warning'>You clear all active holograms, and overload your energy projector!</span>")
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg/hacked
|
||||
creation_time = 30
|
||||
if(signs.len)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 1
|
||||
return
|
||||
else
|
||||
if(signs.len)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, "<span class='notice'>You clear all active holograms.</span>")
|
||||
if(signs.len)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, "<span class='notice'>You clear all active holograms.</span>")
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
throwforce = throwforce_on
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
throw_speed = 4
|
||||
if(attack_verb_on.len)
|
||||
if(length(attack_verb_on))
|
||||
attack_verb = attack_verb_on
|
||||
if(icon_state_on)
|
||||
icon_state = icon_state_on
|
||||
@@ -71,7 +71,7 @@
|
||||
throwforce = throwforce_off
|
||||
hitsound = initial(hitsound)
|
||||
throw_speed = initial(throw_speed)
|
||||
if(attack_verb_on.len)
|
||||
if(length(attack_verb_on))
|
||||
attack_verb = list()
|
||||
icon_state = initial(icon_state)
|
||||
w_class = initial(w_class)
|
||||
@@ -339,7 +339,7 @@
|
||||
throwforce = throwforce_on
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
throw_speed = 4
|
||||
if(attack_verb_on.len)
|
||||
if(length(attack_verb_on))
|
||||
attack_verb = attack_verb_on
|
||||
if(icon_state_on)
|
||||
icon_state = icon_state_on
|
||||
@@ -355,7 +355,7 @@
|
||||
throwforce = throwforce_off
|
||||
hitsound = initial(hitsound)
|
||||
throw_speed = initial(throw_speed)
|
||||
if(attack_verb_on.len)
|
||||
if(length(attack_verb_on))
|
||||
attack_verb = list()
|
||||
icon_state = initial(icon_state)
|
||||
w_class = initial(w_class)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
return TOXLOSS
|
||||
|
||||
/obj/item/storage/bag/trash/update_icon_state()
|
||||
switch(contents.len)
|
||||
switch(length(contents))
|
||||
if(21 to INFINITY)
|
||||
icon_state = "[initial(icon_state)]3"
|
||||
if(11 to 20)
|
||||
@@ -336,7 +336,7 @@
|
||||
// Sets up numbered display to show the stack size of each stored mineral
|
||||
// NOTE: numbered display is turned off currently because it's broken
|
||||
/obj/item/storage/bag/sheetsnatcher/orient2hud(mob/user as mob)
|
||||
var/adjusted_contents = contents.len
|
||||
var/adjusted_contents = length(contents)
|
||||
|
||||
//Numbered contents display
|
||||
var/list/datum/numbered_display/numbered_contents
|
||||
|
||||
@@ -1005,7 +1005,7 @@
|
||||
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
|
||||
if(is_pen(W))
|
||||
//if a pen is used on the sack, dialogue to change its design appears
|
||||
if(contents.len)
|
||||
if(length(contents))
|
||||
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
|
||||
return
|
||||
var/list/designs = list(NODESIGN, NANOTRASEN, SYNDI, HEART, SMILE)
|
||||
@@ -1022,7 +1022,7 @@
|
||||
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
|
||||
return
|
||||
else if(W.sharp)
|
||||
if(!contents.len)
|
||||
if(!length(contents))
|
||||
if(item_state == "paperbag_None")
|
||||
to_chat(user, "<span class='notice'>You cut eyeholes into [src].</span>")
|
||||
new /obj/item/clothing/head/papersack(user.loc)
|
||||
|
||||
@@ -232,15 +232,15 @@
|
||||
new cigarette_type(src)
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][contents.len]"
|
||||
icon_state = "[initial(icon_state)][length(contents)]"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
|
||||
if(istype(M) && M == user && user.zone_selected == "mouth" && contents.len > 0 && !user.wear_mask)
|
||||
if(istype(M) && M == user && user.zone_selected == "mouth" && length(contents) > 0 && !user.wear_mask)
|
||||
var/got_cig = 0
|
||||
for(var/num=1, num <= contents.len, num++)
|
||||
for(var/num=1, num <= length(contents), num++)
|
||||
var/obj/item/I = contents[num]
|
||||
if(istype(I, /obj/item/clothing/mask/cigarette))
|
||||
var/obj/item/clothing/mask/cigarette/C = I
|
||||
@@ -374,7 +374,7 @@
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_overlays()
|
||||
. = ..()
|
||||
if(!contents.len)
|
||||
if(!length(contents))
|
||||
. += "[icon_state]_empty"
|
||||
|
||||
/*
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
overlays += I
|
||||
|
||||
/obj/item/storage/pill_bottle/attack(mob/M, mob/user)
|
||||
if(iscarbon(M) && contents.len)
|
||||
if(iscarbon(M) && length(contents))
|
||||
if(applying_meds)
|
||||
to_chat(user, "<span class='warning'>You are already applying meds.</span>")
|
||||
return
|
||||
@@ -339,7 +339,7 @@
|
||||
if(iscarbon(over_object))
|
||||
var/mob/living/carbon/C = over_object
|
||||
if(loc == C && src == C.get_active_hand())
|
||||
if(!contents.len)
|
||||
if(!length(contents))
|
||||
to_chat(C, "<span class='notice'>There is nothing in [src]!</span>")
|
||||
return
|
||||
C.visible_message("<span class='danger'>[C] [rapid_intake_message]</span>")
|
||||
|
||||
@@ -722,7 +722,7 @@
|
||||
// But then again a tesseract would destroy the server anyways
|
||||
// Also I wish I could just insert a list instead of it reading it the wrong way
|
||||
content_list.len++
|
||||
content_list[content_list.len] = AM.serialize()
|
||||
content_list[length(content_list)] = AM.serialize()
|
||||
return data
|
||||
|
||||
/obj/item/storage/deserialize(list/data)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
new /obj/item/stack/medical/ointment/advanced(src)
|
||||
|
||||
/obj/item/storage/surgical_tray/update_icon_state()
|
||||
if(!contents.len)
|
||||
if(!length(contents))
|
||||
icon_state = "surgical_tray_e"
|
||||
else
|
||||
icon_state = "surgical_tray"
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if(A.tele_proof)
|
||||
continue // Telescience-proofed areas require a beacon.
|
||||
turfs += T
|
||||
if(turfs.len)
|
||||
if(length(turfs))
|
||||
L["None (Dangerous)"] = pick(turfs)
|
||||
var/t1 = tgui_input_list(user, "Please select a teleporter to lock in on.", "Hand Teleporter", L)
|
||||
if(!t1 || (!user.is_in_active_hand(src) || user.stat || user.restrained()))
|
||||
|
||||
Reference in New Issue
Block a user