mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +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
@@ -236,7 +236,7 @@
|
||||
|
||||
/obj/effect/decal/cleanable/blood/writing/Initialize(mapload)
|
||||
. = ..()
|
||||
if(random_icon_states.len)
|
||||
if(length(random_icon_states))
|
||||
for(var/obj/effect/decal/cleanable/blood/writing/W in loc)
|
||||
random_icon_states.Remove(W.icon_state)
|
||||
icon_state = pick(random_icon_states)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
bloodiness -= add_blood
|
||||
S.bloody_shoes[blood_state] = min(MAX_SHOE_BLOODINESS, S.bloody_shoes[blood_state] + add_blood)
|
||||
S.bloody_shoes[BLOOD_BASE_ALPHA] = BLOODY_FOOTPRINT_BASE_ALPHA * (alpha/255)
|
||||
if(blood_DNA && blood_DNA.len)
|
||||
if(blood_DNA && length(blood_DNA))
|
||||
S.add_blood(H.blood_DNA, basecolor)
|
||||
S.blood_state = blood_state
|
||||
S.blood_color = basecolor
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
if(length(dirList))
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
|
||||
@@ -416,7 +416,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/newplayer_start) //Without this you sp
|
||||
/obj/effect/landmark/costume/random/Initialize(mapload) //costume spawner, selects a random subclass and disappears
|
||||
. = ..()
|
||||
var/list/options = (typesof(/obj/effect/landmark/costume) - /obj/effect/landmark/costume/random)
|
||||
var/PICK= options[rand(1,options.len)]
|
||||
var/PICK= options[rand(1,length(options))]
|
||||
new PICK(src.loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -580,7 +580,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/newplayer_start) //Without this you sp
|
||||
var/datum/map_template/ruin/ruin_template
|
||||
|
||||
/obj/effect/landmark/ruin/New(loc, my_ruin_template)
|
||||
name = "ruin_[GLOB.ruin_landmarks.len + 1]"
|
||||
name = "ruin_[length(GLOB.ruin_landmarks) + 1]"
|
||||
..(loc)
|
||||
ruin_template = my_ruin_template
|
||||
GLOB.ruin_landmarks |= src
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in entry_vent.parent.other_atmosmch)
|
||||
vents.Add(temp_vent)
|
||||
if(!vents.len)
|
||||
if(!length(vents))
|
||||
entry_vent = null
|
||||
return
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents)
|
||||
|
||||
@@ -229,7 +229,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
msg += "<span class='danger'>No tech origins detected.</span><BR>"
|
||||
|
||||
|
||||
if(materials.len)
|
||||
if(length(materials))
|
||||
msg += "<span class='notice'>Extractable materials:<BR>"
|
||||
for(var/mat in materials)
|
||||
msg += "[CallMaterialName(mat)]<BR>" //Capitize first word, remove the "$"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
/obj/item/ashtray/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/cigbutt) || istype(I, /obj/item/clothing/mask/cigarette) || istype(I, /obj/item/match))
|
||||
if(contents.len >= max_butts)
|
||||
if(length(contents) >= max_butts)
|
||||
to_chat(user, "This ashtray is full.")
|
||||
return
|
||||
if(!user.unEquip(I))
|
||||
@@ -31,18 +31,18 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/ashtray/update_icon_state()
|
||||
if(contents.len == max_butts)
|
||||
if(length(contents) == max_butts)
|
||||
icon_state = icon_full
|
||||
else if(contents.len > max_butts * 0.5)
|
||||
else if(length(contents) > max_butts * 0.5)
|
||||
icon_state = icon_half
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/ashtray/update_desc()
|
||||
. = ..()
|
||||
if(contents.len == max_butts)
|
||||
if(length(contents) == max_butts)
|
||||
desc = initial(desc) + " It's stuffed full."
|
||||
else if(contents.len > max_butts * 0.5)
|
||||
else if(length(contents) > max_butts * 0.5)
|
||||
desc = initial(desc) + " It's half-filled."
|
||||
else
|
||||
desc = initial(desc)
|
||||
@@ -53,7 +53,7 @@
|
||||
update_appearance(UPDATE_DESC|UPDATE_ICON_STATE)
|
||||
|
||||
/obj/item/ashtray/throw_impact(atom/hit_atom)
|
||||
if(contents.len)
|
||||
if(length(contents))
|
||||
visible_message("<span class='warning'>[src] slams into [hit_atom] spilling its contents!</span>")
|
||||
empty_tray()
|
||||
return ..()
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
A.always_unpowered = FALSE
|
||||
A.set_dynamic_lighting()
|
||||
|
||||
for(var/i in 1 to turfs.len)
|
||||
for(var/i in 1 to length(turfs))
|
||||
var/turf/thing = turfs[i]
|
||||
var/area/old_area = thing.loc
|
||||
A.contents += thing
|
||||
@@ -293,8 +293,8 @@
|
||||
/obj/item/areaeditor/proc/detect_room(turf/first)
|
||||
var/list/turf/found = new
|
||||
var/list/turf/pending = list(first)
|
||||
while(pending.len)
|
||||
if(found.len+pending.len > 300)
|
||||
while(length(pending))
|
||||
if(found.len+length(pending) > 300)
|
||||
return ROOM_ERR_TOOLARGE
|
||||
var/turf/T = pending[1] //why byond havent list::pop()?
|
||||
pending -= T
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
return W
|
||||
|
||||
/obj/item/autopsy_scanner/proc/add_data(obj/item/organ/O)
|
||||
if(O.autopsy_data.len)
|
||||
if(length(O.autopsy_data))
|
||||
for(var/V in O.autopsy_data)
|
||||
var/datum/autopsy_data/W = O.autopsy_data[V]
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
qdel(D.organs_scanned[O.name])
|
||||
D.organs_scanned[O.name] = W.copy()
|
||||
|
||||
if(O.trace_chemicals.len)
|
||||
if(length(O.trace_chemicals))
|
||||
for(var/V in O.trace_chemicals)
|
||||
if(O.trace_chemicals[V] > 0 && !chemtraces.Find(V))
|
||||
chemtraces += V
|
||||
@@ -97,7 +97,7 @@
|
||||
else
|
||||
scan_data += "<b>Time of death:</b> Unknown / Still alive<br><br>"
|
||||
|
||||
if(wdata.len)
|
||||
if(length(wdata))
|
||||
var/n = 1
|
||||
for(var/wdata_idx in wdata)
|
||||
var/datum/autopsy_data_scanner/D = wdata[wdata_idx]
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
n++
|
||||
|
||||
if(chemtraces.len)
|
||||
if(length(chemtraces))
|
||||
scan_data += "<b>Trace Chemicals: </b><br>"
|
||||
for(var/chemID in chemtraces)
|
||||
scan_data += chemID
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
var/G //Generator that will be spawned
|
||||
var/turf/T = get_turf(choice)
|
||||
|
||||
if(choice.enginetype.len > 1) //If the beacon has multiple engine types
|
||||
if(length(choice.enginetype) > 1) //If the beacon has multiple engine types
|
||||
var/E = tgui_input_list(user, "You have selected a combined beacon, which option would you prefer?", "[src]", choice.enginetype)
|
||||
if(E)
|
||||
engtype = E
|
||||
@@ -76,7 +76,7 @@
|
||||
var/ailist[] = list()
|
||||
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
|
||||
ailist += A
|
||||
if(ailist.len)
|
||||
if(length(ailist))
|
||||
var/mob/living/silicon/ai/announcer = pick(ailist)
|
||||
announcer.say(";Engine delivery detected. Type: [engtype].") //Let's announce the terrible choice to everyone
|
||||
|
||||
|
||||
@@ -490,11 +490,11 @@
|
||||
|
||||
/obj/item/radio/headset/proc/setupRadioDescription()
|
||||
var/radio_text = ""
|
||||
for(var/i = 1 to channels.len)
|
||||
for(var/i = 1 to length(channels))
|
||||
var/channel = channels[i]
|
||||
var/key = get_radio_key_from_channel(channel)
|
||||
radio_text += "[key] - [channel]"
|
||||
if(i != channels.len)
|
||||
if(i != length(channels))
|
||||
radio_text += ", "
|
||||
|
||||
radio_desc = radio_text
|
||||
|
||||
@@ -258,7 +258,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
|
||||
|
||||
/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown", follow_target_override) //BS12 EDIT
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel && channels && length(channels) > 0)
|
||||
if(channel == "department")
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
@@ -343,7 +343,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
|
||||
return radio_connection
|
||||
|
||||
// Otherwise, if a channel is specified, look for it.
|
||||
if(channels && channels.len > 0)
|
||||
if(channels && length(channels) > 0)
|
||||
if(message_mode == "department") // Department radio shortcut
|
||||
message_mode = channels[1]
|
||||
|
||||
|
||||
@@ -80,13 +80,13 @@ SLIME SCANNER
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.reagents)
|
||||
if(H.reagents.reagent_list.len)
|
||||
if(length(H.reagents.reagent_list))
|
||||
msgs += "<span class='boldnotice'>Subject contains the following reagents:</span>"
|
||||
for(var/datum/reagent/R in H.reagents.reagent_list)
|
||||
msgs += "<span class='notice'>[R.volume]u of [R.name][R.overdosed ? "</span> - <span class = 'boldannounceic'>OVERDOSING</span>" : ".</span>"]"
|
||||
else
|
||||
msgs += "<span class='notice'>Subject contains no reagents.</span>"
|
||||
if(H.reagents.addiction_list.len)
|
||||
if(length(H.reagents.addiction_list))
|
||||
msgs += "<span class='danger'>Subject is addicted to the following reagents:</span>"
|
||||
for(var/datum/reagent/R in H.reagents.addiction_list)
|
||||
msgs += "<span class='danger'>[R.name] Stage: [R.addiction_stage]/5</span>"
|
||||
@@ -664,7 +664,7 @@ SLIME SCANNER
|
||||
if(!isnull(O.reagents))
|
||||
var/dat = ""
|
||||
var/blood_type = ""
|
||||
if(O.reagents.reagent_list.len > 0)
|
||||
if(length(O.reagents.reagent_list) > 0)
|
||||
var/one_percent = O.reagents.total_volume / 100
|
||||
for(var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if(R.id != "blood")
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
|
||||
var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
|
||||
var/t1 = "<B>Transcript:</B><BR><BR>"
|
||||
for(var/i = 1, mytape.storedinfo.len >= i, i++)
|
||||
for(var/i = 1, length(mytape.storedinfo) >= i, i++)
|
||||
t1 += "[mytape.storedinfo[i]]<BR>"
|
||||
P.info = t1
|
||||
P.name = "paper- 'Transcript'"
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc)
|
||||
playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(destination)
|
||||
else if(!EMP_D && !(bagholding.len && !flawless)) // This is where the fun begins
|
||||
else if(!EMP_D && !(length(bagholding) && !flawless)) // This is where the fun begins
|
||||
var/direction = get_dir(user, destination)
|
||||
panic_teleport(user, destination, direction)
|
||||
else // Emp activated? Bag of holding? No saving throw for you
|
||||
|
||||
@@ -64,13 +64,13 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
for(var/category in uplink_items)
|
||||
cats[++cats.len] = list("cat" = category, "items" = list())
|
||||
for(var/datum/uplink_item/I in uplink_items[category])
|
||||
if(I.job && I.job.len)
|
||||
if(I.job && length(I.job))
|
||||
if(!(I.job.Find(job)) && uplink_type != UPLINK_TYPE_ADMIN)
|
||||
continue
|
||||
if(length(I.species))
|
||||
if(!(I.species.Find(species)) && uplink_type != UPLINK_TYPE_ADMIN)
|
||||
continue
|
||||
cats[cats.len]["items"] += list(list(
|
||||
cats[length(cats)]["items"] += list(list(
|
||||
"name" = sanitize(I.name),
|
||||
"desc" = sanitize(I.description()),
|
||||
"cost" = I.cost,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
to_chat(user, "<span class='warning'>You should clean [src] before you use it for food prep.</span>")
|
||||
return 0
|
||||
if(is_type_in_list(I, GLOB.cooking_ingredients[RECIPE_MICROWAVE]) || is_type_in_list(I, GLOB.cooking_ingredients[RECIPE_GRILL]) || is_type_in_list(I, GLOB.cooking_ingredients[RECIPE_OVEN]) || is_type_in_list(I, GLOB.cooking_ingredients[RECIPE_CANDY]))
|
||||
if(contents.len>=max_n_of_items)
|
||||
if(length(contents)>=max_n_of_items)
|
||||
to_chat(user, "<span class='alert'>This [src] is full of ingredients, you cannot put more.</span>")
|
||||
return 1
|
||||
if(istype(I, /obj/item/stack))
|
||||
@@ -103,7 +103,7 @@
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if(items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
if(length(items_counts)==0 && length(reagents.reagent_list)==0)
|
||||
dat = {"<B>[src] is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
recipe_list = srl.recipes
|
||||
|
||||
var/t1 = "Amount Left: [get_amount()]<br>"
|
||||
for(var/i in 1 to recipe_list.len)
|
||||
for(var/i in 1 to length(recipe_list))
|
||||
var/E = recipe_list[i]
|
||||
if(isnull(E))
|
||||
t1 += "<hr>"
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
if(!detect_state && GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z))
|
||||
var/datum/camerachunk/chunk = GLOB.cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z)
|
||||
if(chunk)
|
||||
if(chunk.seenby.len)
|
||||
if(length(chunk.seenby))
|
||||
for(var/mob/camera/aiEye/A in chunk.seenby)
|
||||
//Checks if the A is to be detected or not
|
||||
if(!A.ai_detector_visible)
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -339,8 +339,8 @@ LINEN BINS
|
||||
amount--
|
||||
|
||||
var/obj/item/bedsheet/B
|
||||
if(sheets.len > 0)
|
||||
B = sheets[sheets.len]
|
||||
if(length(sheets) > 0)
|
||||
B = sheets[length(sheets)]
|
||||
sheets.Remove(B)
|
||||
|
||||
else
|
||||
@@ -364,8 +364,8 @@ LINEN BINS
|
||||
amount--
|
||||
|
||||
var/obj/item/bedsheet/B
|
||||
if(sheets.len > 0)
|
||||
B = sheets[sheets.len]
|
||||
if(length(sheets) > 0)
|
||||
B = sheets[length(sheets)]
|
||||
sheets.Remove(B)
|
||||
|
||||
else
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
/obj/structure/displaycase/Initialize(mapload)
|
||||
. = ..()
|
||||
if(start_showpieces.len && !start_showpiece_type)
|
||||
if(length(start_showpieces) && !start_showpiece_type)
|
||||
var/list/showpiece_entry = pick(start_showpieces)
|
||||
if(showpiece_entry && showpiece_entry["type"])
|
||||
start_showpiece_type = showpiece_entry["type"]
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
/obj/structure/bed/roller/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/roller_holder))
|
||||
if(has_buckled_mobs())
|
||||
if(buckled_mobs.len > 1)
|
||||
if(length(buckled_mobs) > 1)
|
||||
unbuckle_all_mobs()
|
||||
user.visible_message("<span class='notice'>[user] unbuckles all creatures from [src].</span>")
|
||||
else
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
return
|
||||
|
||||
if(cistern && !open)
|
||||
if(!contents.len)
|
||||
if(!length(contents))
|
||||
to_chat(user, "<span class='notice'>The cistern is empty.</span>")
|
||||
return
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user