From bad8b31afa88f846ebb72ff1820f07e1ba85e7b6 Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:32:09 +0200 Subject: [PATCH] Changes all .len to length() where applicable (#25174) * Globals work * Double access works * All other things * Revert "All other things" This reverts commit 6574442eb651a79ec87c63b37034b2a70e693a79. * 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) Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com> --- code/__HELPERS/colour_helpers.dm | 6 +- code/__HELPERS/game.dm | 10 +- code/__HELPERS/heap.dm | 14 +- code/__HELPERS/icon_helpers.dm | 6 +- code/__HELPERS/icon_smoothing.dm | 2 +- code/__HELPERS/lists.dm | 124 +++++++++--------- code/__HELPERS/mob_helpers.dm | 12 +- code/__HELPERS/sanitize_values.dm | 2 +- code/__HELPERS/sorts/InsertSort.dm | 10 +- code/__HELPERS/sorts/MergeSort.dm | 10 +- code/__HELPERS/sorts/TimSort.dm | 10 +- code/__HELPERS/sorts/__main.dm | 22 ++-- code/__HELPERS/text.dm | 4 +- code/__HELPERS/type2type.dm | 2 +- code/_onclick/hud/alert.dm | 4 +- code/_onclick/hud/radial.dm | 24 ++-- code/_onclick/hud/robot_hud.dm | 2 +- code/_onclick/hud/screen_objects.dm | 2 +- code/_onclick/item_attack.dm | 2 +- code/controllers/globals.dm | 8 +- code/controllers/master.dm | 4 +- code/controllers/subsystem/SSacid.dm | 4 +- code/controllers/subsystem/SSafk.dm | 2 +- code/controllers/subsystem/SSair.dm | 46 +++---- code/controllers/subsystem/SSblackbox.dm | 10 +- code/controllers/subsystem/SSfires.dm | 4 +- code/controllers/subsystem/SSgarbage.dm | 2 +- code/controllers/subsystem/SSicon_smooth.dm | 6 +- code/controllers/subsystem/SSidlenpcpool.dm | 4 +- code/controllers/subsystem/SSjobs.dm | 18 +-- code/controllers/subsystem/SSmachinery.dm | 14 +- code/controllers/subsystem/SSmobs.dm | 4 +- .../subsystem/SSnano_mob_hunter.dm | 8 +- code/controllers/subsystem/SSnpcpool.dm | 4 +- code/controllers/subsystem/SSoverlays.dm | 24 ++-- code/controllers/subsystem/SSparallax.dm | 2 +- code/controllers/subsystem/SSping.dm | 2 +- code/controllers/subsystem/SSshuttles.dm | 6 +- code/controllers/subsystem/SSspacedrift.dm | 4 +- code/controllers/subsystem/SStgui.dm | 4 +- code/controllers/subsystem/SSthrowing.dm | 2 +- code/controllers/subsystem/SSticker.dm | 8 +- .../subsystem/non_firing/SSatoms.dm | 4 +- .../subsystem/non_firing/SSmapping.dm | 6 +- .../subsystem/non_firing/SSradio.dm | 2 +- .../subsystem/non_firing/SStitlescreen.dm | 6 +- .../subsystem/processing/processing.dm | 4 +- code/controllers/subsystem/tickets/tickets.dm | 2 +- code/datums/ai_laws_datums.dm | 26 ++-- code/datums/components/_component.dm | 8 +- code/datums/components/material_container.dm | 4 +- code/datums/components/spawner.dm | 2 +- code/datums/components/swarming.dm | 6 +- code/datums/datacore.dm | 34 ++--- code/datums/datumvars.dm | 18 +-- code/datums/diseases/advance/advance.dm | 34 ++--- .../advance/symptoms/damage_converter.dm | 2 +- code/datums/diseases/advance/symptoms/heal.dm | 2 +- .../diseases/advance/symptoms/symptoms.dm | 2 +- code/datums/helper_datums/async_input.dm | 6 +- .../helper_datums/construction_datum.dm | 16 +-- code/datums/helper_datums/teleport.dm | 2 +- code/datums/holocall.dm | 4 +- code/datums/mind.dm | 16 +-- code/datums/outfits/vv_outfit.dm | 2 +- code/datums/progressbar.dm | 4 +- code/datums/radiation_wave.dm | 2 +- code/datums/radio_frequency.dm | 8 +- code/datums/recipe.dm | 16 +-- code/datums/spells/area_teleport.dm | 4 +- code/datums/spells/charge.dm | 2 +- code/datums/spells/conjure.dm | 2 +- code/datums/spells/horsemask.dm | 2 +- code/datums/spells/mind_transfer.dm | 8 +- code/datums/spells/turf_teleport.dm | 2 +- code/datums/uplink_items/uplink_general.dm | 2 +- .../datums/weather/weather_types/ash_storm.dm | 2 +- code/game/alternate_appearance.dm | 6 +- code/game/area/areas/depot-areas.dm | 10 +- code/game/atoms.dm | 20 +-- code/game/dna/dna2.dm | 8 +- code/game/dna/dna2_helpers.dm | 24 ++-- code/game/dna/dna_modifier.dm | 4 +- code/game/dna/mutations/disabilities.dm | 2 +- code/game/dna/mutations/mutation_powers.dm | 14 +- .../game/gamemodes/autotraitor/autotraitor.dm | 6 +- code/game/gamemodes/game_mode.dm | 2 +- code/game/gamemodes/intercept_report.dm | 4 +- .../abduction/abductee_objectives.dm | 2 +- .../miniantags/abduction/abduction.dm | 6 +- .../demons/slaughter_demon/slaughter.dm | 4 +- .../gamemodes/miniantags/guardian/guardian.dm | 2 +- .../guardian/types/lightning_guardian.dm | 8 +- .../gamemodes/miniantags/morph/morph_event.dm | 2 +- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- .../revenant/revenant_spawn_event.dm | 2 +- code/game/gamemodes/nuclear/nuclear.dm | 10 +- .../gamemodes/nuclear/nuclear_challenge.dm | 6 +- code/game/gamemodes/nuclear/pinpointer.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- code/game/gamemodes/setupgame.dm | 4 +- code/game/gamemodes/vampire/traitor_vamp.dm | 2 +- code/game/gamemodes/wizard/artefact.dm | 4 +- code/game/gamemodes/wizard/raginmages.dm | 2 +- code/game/gamemodes/wizard/spellbook.dm | 6 +- code/game/gamemodes/wizard/wizard.dm | 2 +- code/game/jobs/access.dm | 2 +- code/game/jobs/job/job.dm | 2 +- code/game/jobs/job/silicon_jobs.dm | 2 +- code/game/jobs/job_exp.dm | 6 +- code/game/machinery/adv_med.dm | 4 +- code/game/machinery/autolathe.dm | 22 ++-- code/game/machinery/camera/camera_assembly.dm | 4 +- code/game/machinery/camera/tracking.dm | 4 +- code/game/machinery/computer/ai_core.dm | 2 +- code/game/machinery/computer/arcade.dm | 11 +- .../machinery/computer/camera_advanced.dm | 2 +- .../game/machinery/computer/camera_console.dm | 2 +- code/game/machinery/computer/card.dm | 4 +- .../game/machinery/computer/communications.dm | 2 +- .../machinery/computer/message_monitor.dm | 2 +- code/game/machinery/constructable_frame.dm | 8 +- code/game/machinery/cryopod.dm | 6 +- code/game/machinery/doors/airlock.dm | 4 +- code/game/machinery/doors/windowdoor.dm | 6 +- code/game/machinery/doppler_array.dm | 2 +- code/game/machinery/hologram.dm | 4 +- code/game/machinery/machinery.dm | 2 +- code/game/machinery/magnetic_module.dm | 6 +- code/game/machinery/poolcontroller.dm | 2 +- code/game/machinery/portable_turret.dm | 12 +- code/game/machinery/syndicatebomb.dm | 8 +- code/game/machinery/teleporter.dm | 4 +- code/game/mecha/combat/honker.dm | 2 +- code/game/mecha/combat/marauder.dm | 2 +- code/game/mecha/equipment/mecha_equipment.dm | 2 +- .../mecha/equipment/tools/medical_tools.dm | 18 +-- code/game/mecha/equipment/tools/work_tools.dm | 4 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 4 +- code/game/mecha/mecha_topic.dm | 12 +- code/game/mecha/mecha_wreckage.dm | 4 +- code/game/mecha/working/ripley.dm | 4 +- .../effects/decals/Cleanable/humans.dm | 2 +- code/game/objects/effects/decals/cleanable.dm | 2 +- code/game/objects/effects/glowshroom.dm | 2 +- code/game/objects/effects/landmarks.dm | 4 +- code/game/objects/effects/spiders.dm | 2 +- code/game/objects/items.dm | 2 +- code/game/objects/items/ashtray.dm | 12 +- code/game/objects/items/blueprints.dm | 6 +- code/game/objects/items/devices/autopsy.dm | 8 +- .../objects/items/devices/enginepicker.dm | 4 +- .../objects/items/devices/radio/headset.dm | 4 +- .../items/devices/radio/radio_objects.dm | 4 +- code/game/objects/items/devices/scanners.dm | 6 +- .../objects/items/devices/taperecorder.dm | 2 +- .../objects/items/devices/traitordevices.dm | 2 +- code/game/objects/items/devices/uplinks.dm | 4 +- code/game/objects/items/mixing_bowl.dm | 4 +- code/game/objects/items/stacks/stack.dm | 2 +- code/game/objects/items/tools/multitool.dm | 2 +- code/game/objects/items/weapons/cigs.dm | 2 +- .../items/weapons/grenades/chem_grenade.dm | 6 +- .../items/weapons/holosign_projector.dm | 14 +- .../weapons/melee/energy_melee_weapons.dm | 8 +- .../objects/items/weapons/storage/bags.dm | 4 +- .../objects/items/weapons/storage/boxes.dm | 4 +- .../objects/items/weapons/storage/fancy.dm | 8 +- .../objects/items/weapons/storage/firstaid.dm | 4 +- .../items/weapons/storage/storage_base.dm | 2 +- .../items/weapons/storage/surgical_tray.dm | 2 +- .../objects/items/weapons/teleportation.dm | 2 +- code/game/objects/structures/bedsheet_bin.dm | 8 +- code/game/objects/structures/displaycase.dm | 2 +- .../structures/stool_bed_chair_nest/bed.dm | 2 +- code/game/objects/structures/watercloset.dm | 2 +- code/game/turfs/simulated/river.dm | 2 +- code/game/turfs/simulated/walls.dm | 10 +- code/game/turfs/simulated/walls_mineral.dm | 4 +- code/game/turfs/space/space_turf.dm | 8 +- code/game/verbs/randomtip.dm | 4 +- code/game/world.dm | 2 +- code/modules/admin/admin_memo.dm | 2 +- code/modules/admin/admin_verbs.dm | 2 +- code/modules/admin/misc_admin_procs.dm | 8 +- code/modules/admin/player_panel.dm | 40 +++--- code/modules/admin/topic.dm | 20 +-- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 20 +-- .../admin/verbs/SDQL2/SDQL_2_parser.dm | 6 +- code/modules/admin/verbs/atmosdebug.dm | 8 +- code/modules/admin/verbs/debug.dm | 12 +- code/modules/admin/verbs/diagnostics.dm | 2 +- code/modules/admin/verbs/gimmick_team.dm | 4 +- .../admin/verbs/infiltratorteam_syndicate.dm | 8 +- code/modules/admin/verbs/logging_view.dm | 2 +- code/modules/admin/verbs/massmodvar.dm | 10 +- code/modules/admin/verbs/modifyvariables.dm | 8 +- code/modules/admin/verbs/one_click_antag.dm | 18 +-- code/modules/admin/verbs/randomverbs.dm | 6 +- .../antagonists/_common/antag_spawner.dm | 4 +- .../antagonists/changeling/powers/absorb.dm | 4 +- code/modules/arcade/mob_hunt/mob_datums.dm | 6 +- code/modules/asset_cache/asset_list.dm | 2 +- .../atmospherics/environmental/LINDA_fire.dm | 2 +- .../environmental/LINDA_turf_tile.dm | 2 +- .../atmospherics/machinery/airalarm.dm | 24 ++-- .../components/unary_devices/cryo.dm | 2 +- .../atmospherics/machinery/datum_pipeline.dm | 6 +- .../atmospherics/machinery/pipes/pipe.dm | 2 +- code/modules/awaymissions/loot.dm | 4 +- code/modules/awaymissions/maploader/reader.dm | 16 +-- code/modules/buildmode/submodes/link.dm | 4 +- .../client/preference/link_processing.dm | 4 +- .../client/preference/loadout/gear_tweaks.dm | 10 +- code/modules/clothing/clothing.dm | 2 +- .../clothing/under/accessories/accessory.dm | 4 +- code/modules/crafting/craft.dm | 20 +-- code/modules/detective_work/evidence.dm | 4 +- .../economy/economy_events/economy_events.dm | 2 +- .../economy_events/economy_events_mundane.dm | 2 +- code/modules/error_handler/error_handler.dm | 2 +- code/modules/events/abductor_event.dm | 2 +- code/modules/events/blob/blob_powers.dm | 6 +- .../events/blob/blob_structures/factory.dm | 2 +- code/modules/events/blob/theblob.dm | 2 +- code/modules/events/carp_migration.dm | 4 +- code/modules/events/electrical_storm.dm | 4 +- code/modules/events/event_container.dm | 6 +- code/modules/events/event_procs.dm | 2 +- code/modules/events/ion_storm.dm | 2 +- code/modules/events/money_spam.dm | 2 +- code/modules/events/prison_break.dm | 4 +- code/modules/events/rogue_drones.dm | 2 +- code/modules/events/spacevine.dm | 12 +- code/modules/events/traders.dm | 4 +- code/modules/events/undead_event.dm | 6 +- code/modules/events/vent_clog.dm | 2 +- code/modules/events/wormholes.dm | 2 +- code/modules/flufftext/Dreaming.dm | 6 +- .../food_and_drinks/drinks/bottler/bottler.dm | 12 +- .../drinks/drinks/drinkingglass.dm | 2 +- .../modules/food_and_drinks/food/condiment.dm | 8 +- .../food_and_drinks/food/customizables.dm | 14 +- .../food_and_drinks/food/foods/pizza.dm | 24 ++-- code/modules/food_and_drinks/food/snacks.dm | 2 +- .../kitchen_machinery/gibber.dm | 4 +- .../kitchen_machinery/kitchen_machine.dm | 4 +- .../kitchen_machinery/processor.dm | 2 +- code/modules/games/tarot.dm | 2 +- code/modules/hydroponics/beekeeping/beebox.dm | 22 ++-- code/modules/hydroponics/grown/kudzu.dm | 6 +- .../mining/equipment/wormhole_jaunter.dm | 2 +- code/modules/mining/fulton.dm | 2 +- .../mining/lavaland/loot/colossus_loot.dm | 2 +- code/modules/mining/machine_processing.dm | 2 +- code/modules/mining/minebot.dm | 2 +- code/modules/mob/hear_say.dm | 4 +- code/modules/mob/language.dm | 8 +- .../carbon/alien/special/alien_embryo.dm | 2 +- code/modules/mob/living/carbon/carbon_life.dm | 2 +- .../modules/mob/living/carbon/carbon_procs.dm | 2 +- .../mob/living/carbon/human/appearance.dm | 14 +- .../living/carbon/human/body_accessories.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 12 +- .../mob/living/carbon/human/human_examine.dm | 2 +- .../living/carbon/human/human_inventory.dm | 4 +- .../mob/living/carbon/human/human_life.dm | 2 +- .../mob/living/carbon/human/human_mob.dm | 4 +- .../mob/living/carbon/human/human_organs.dm | 2 +- .../mob/living/carbon/human/human_say.dm | 2 +- .../living/carbon/human/human_update_icons.dm | 2 +- .../living/carbon/human/species/_species.dm | 4 +- .../mob/living/carbon/human/species/golem.dm | 6 +- .../carbon/human/species/slimepeople.dm | 2 +- code/modules/mob/living/carbon/superheroes.dm | 4 +- code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/living_say.dm | 6 +- code/modules/mob/living/silicon/ai/ai_mob.dm | 18 +-- .../modules/mob/living/silicon/ai/latejoin.dm | 2 +- .../living/silicon/robot/drone/drone_items.dm | 4 +- .../mob/living/silicon/robot/robot_mob.dm | 2 +- .../modules/mob/living/silicon/silicon_mob.dm | 8 +- .../simple_animal/bot/bot_construction.dm | 6 +- .../mob/living/simple_animal/bot/ed209bot.dm | 4 +- .../mob/living/simple_animal/bot/mulebot.dm | 2 +- .../simple_animal/friendly/diona_nymph.dm | 8 +- .../simple_animal/friendly/farm_animals.dm | 4 +- .../mob/living/simple_animal/hostile/bees.dm | 2 +- .../simple_animal/hostile/floorcluwne.dm | 2 +- .../living/simple_animal/hostile/hostile.dm | 6 +- .../hostile/megafauna/bubblegum.dm | 16 +-- .../hostile/megafauna/hierophant.dm | 6 +- .../simple_animal/hostile/mimic_mobs.dm | 4 +- .../simple_animal/hostile/mining/goldgrub.dm | 2 +- .../hostile/retaliate/retaliate.dm | 2 +- .../simple_animal/hostile/syndicate_mobs.dm | 4 +- .../hostile/terror_spiders/reproduction.dm | 2 +- .../hostile/terror_spiders/terror_ai.dm | 6 +- .../hostile/terror_spiders/terror_spiders.dm | 2 +- .../simple_animal/hostile/venus_human_trap.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 4 +- .../mob/living/simple_animal/simple_animal.dm | 32 ++--- .../living/simple_animal/slime/slime_life.dm | 4 +- .../living/simple_animal/slime/slime_mob.dm | 4 +- code/modules/mob/mob.dm | 8 +- code/modules/mob/mob_holder.dm | 2 +- code/modules/mob/mob_login_base.dm | 2 +- code/modules/mob/mob_movement.dm | 2 +- code/modules/mob/new_player/new_player.dm | 4 +- code/modules/paperwork/folders.dm | 2 +- code/modules/paperwork/paperbin.dm | 8 +- code/modules/paperwork/photocopier.dm | 4 +- code/modules/paperwork/photography.dm | 10 +- code/modules/paperwork/silicon_photography.dm | 2 +- code/modules/pda/app.dm | 2 +- code/modules/pda/cart_apps.dm | 16 +-- code/modules/pda/mob_hunt_game_app.dm | 18 +-- code/modules/pda/utilities.dm | 4 +- .../engines/singularity/field_generator.dm | 8 +- code/modules/power/generators/solar.dm | 4 +- .../power/powernets/powernet_helpers.dm | 2 +- .../procedural_mapping/mapGenerator.dm | 4 +- code/modules/projectiles/gun.dm | 2 +- .../guns/energy/kinetic_accelerator.dm | 2 +- code/modules/projectiles/guns/energy_guns.dm | 6 +- .../projectiles/guns/grenade_launcher.dm | 8 +- .../projectiles/guns/projectile/shotgun.dm | 2 +- .../projectiles/guns/projectile/sniper.dm | 2 +- code/modules/projectiles/guns/syringe_gun.dm | 2 +- code/modules/projectiles/guns/throw.dm | 4 +- code/modules/projectiles/projectile_base.dm | 4 +- code/modules/reagents/chem_splash.dm | 6 +- .../chemistry/machinery/chem_dispenser.dm | 2 +- .../chemistry/machinery/chem_master.dm | 2 +- .../reagents/chemistry/machinery/pandemic.dm | 12 +- .../reagents/chemistry/reagents/alcohol.dm | 6 +- .../chemistry/reagents/food_reagents.dm | 2 +- .../reagents/reagent_containers/hypospray.dm | 2 +- .../reagents/reagent_containers/spray.dm | 4 +- code/modules/recycling/disposal.dm | 10 +- code/modules/research/destructive_analyzer.dm | 2 +- code/modules/research/experimentor.dm | 6 +- code/modules/research/rdconsole.dm | 2 +- code/modules/research/research.dm | 4 +- code/modules/research/server.dm | 4 +- .../research/xenobiology/xenobiology.dm | 2 +- code/modules/response_team/ert.dm | 6 +- .../modules/ruins/lavalandruin_code/puzzle.dm | 6 +- code/modules/shuttle/emergency.dm | 12 +- code/modules/shuttle/navigation_computer.dm | 8 +- code/modules/shuttle/shuttle.dm | 30 ++--- code/modules/space_management/space_level.dm | 6 +- .../space_management/space_transition.dm | 6 +- .../space_management/zlevel_manager.dm | 8 +- code/modules/station_goals/dna_vault.dm | 4 +- code/modules/station_goals/shield.dm | 2 +- code/modules/surgery/organs/augments_arms.dm | 4 +- code/modules/surgery/organs/blood.dm | 6 +- code/modules/surgery/organs/organ_external.dm | 8 +- code/modules/surgery/organs/organ_icon.dm | 2 +- code/modules/surgery/organs/vocal_cords.dm | 6 +- code/modules/telesci/gps.dm | 2 +- code/modules/telesci/telesci_computer.dm | 2 +- code/modules/tgs/core/tgs_version.dm | 6 +- code/modules/tgs/v3210/v3_api.dm | 12 +- code/modules/tgui/modules/ert_manager.dm | 2 +- code/modules/tgui/modules/law_manager.dm | 2 +- code/modules/tgui/tgui_panel/telemetry.dm | 2 +- 369 files changed, 1162 insertions(+), 1163 deletions(-) diff --git a/code/__HELPERS/colour_helpers.dm b/code/__HELPERS/colour_helpers.dm index b9853409725..2c8668fd400 100644 --- a/code/__HELPERS/colour_helpers.dm +++ b/code/__HELPERS/colour_helpers.dm @@ -3,9 +3,9 @@ var/list/RGB2 = rgb2num(rgb2) // add missing alpha if needed - if(RGB1.len < RGB2.len) RGB1 += 255 - else if(RGB2.len < RGB1.len) RGB2 += 255 - var/usealpha = RGB1.len > 3 + if(length(RGB1) < length(RGB2)) RGB1 += 255 + else if(length(RGB2) < length(RGB1)) RGB2 += 255 + var/usealpha = length(RGB1) > 3 var/r = round(RGB1[1] + (RGB2[1] - RGB1[1]) * amount, 1) var/g = round(RGB1[2] + (RGB2[2] - RGB1[2]) * amount, 1) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 1bba4042d0c..c30ca477cae 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -314,7 +314,7 @@ var/roletext = get_roletext(be_special_type) var/list/candidates = list() // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) - while(!candidates.len && afk_bracket < 6000) + while(!length(candidates) && afk_bracket < 6000) for(var/mob/dead/observer/G in GLOB.player_list) if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) @@ -330,7 +330,7 @@ var/roletext = get_roletext(be_special_type) var/list/candidates = list() // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) - while(!candidates.len && afk_bracket < 6000) + while(!length(candidates) && afk_bracket < 6000) for(var/mob/dead/observer/G in GLOB.player_list) if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) @@ -362,7 +362,7 @@ /proc/get_active_player_count() // Get active players who are playing in the round var/active_players = 0 - for(var/i = 1; i <= GLOB.player_list.len; i++) + for(var/i = 1; i <= length(GLOB.player_list); i++) var/mob/M = GLOB.player_list[i] if(M && M.client) if(isnewplayer(M)) // exclude people in the lobby @@ -447,7 +447,7 @@ /proc/pollCandidatesWithVeto(adminclient, adminusr, max_slots, Question, be_special_type, antag_age_check = FALSE, poll_time = 300, ignore_respawnability = FALSE, min_hours = FALSE, flashwindow = TRUE, check_antaghud = TRUE, source, role_cleanname) var/list/willing_ghosts = SSghost_spawns.poll_candidates(Question, be_special_type, antag_age_check, poll_time, ignore_respawnability, min_hours, flashwindow, check_antaghud, source, role_cleanname) var/list/selected_ghosts = list() - if(!willing_ghosts.len) + if(!length(willing_ghosts)) return selected_ghosts var/list/candidate_ghosts = willing_ghosts.Copy() @@ -459,7 +459,7 @@ else candidate_ghosts -= G - for(var/i = max_slots, (i > 0 && candidate_ghosts.len), i--) + for(var/i = max_slots, (i > 0 && length(candidate_ghosts)), i--) var/this_ghost = input("Pick players. This will go on until there either no more ghosts to pick from or the [i] remaining slot(s) are full.", "Candidates") as null|anything in candidate_ghosts candidate_ghosts -= this_ghost selected_ghosts += this_ghost diff --git a/code/__HELPERS/heap.dm b/code/__HELPERS/heap.dm index c9ad037755f..3d827dda0cf 100644 --- a/code/__HELPERS/heap.dm +++ b/code/__HELPERS/heap.dm @@ -12,23 +12,23 @@ cmp = compare /datum/heap/proc/IsEmpty() - return !L.len + return !length(L) //Insert and place at its position a new node in the heap /datum/heap/proc/Insert(atom/A) L.Add(A) - Swim(L.len) + Swim(length(L)) //removes and returns the first element of the heap //(i.e the max or the min dependant on the comparison function) /datum/heap/proc/Pop() - if(!L.len) + if(!length(L)) return null . = L[1] - L[1] = L[L.len] - L.Cut(L.len) + L[1] = L[length(L)] + L.Cut(length(L)) Sink(1) @@ -53,10 +53,10 @@ //Returns the greater (relative to the comparison proc) of a node children //or 0 if there's no child /datum/heap/proc/GetGreaterChild(index) - if(index * 2 > L.len) + if(index * 2 > length(L)) return 0 - if(index * 2 + 1 > L.len) + if(index * 2 + 1 > length(L)) return index * 2 if(call(cmp)(L[index * 2], L[index * 2 + 1]) < 0) diff --git a/code/__HELPERS/icon_helpers.dm b/code/__HELPERS/icon_helpers.dm index da7a0cfb9be..f51269e72b1 100644 --- a/code/__HELPERS/icon_helpers.dm +++ b/code/__HELPERS/icon_helpers.dm @@ -86,7 +86,7 @@ var/curblend = A.blend_mode || defblend - if(A.overlays.len || A.underlays.len) + if(length(A.overlays) || length(A.underlays)) var/icon/flat = BLANK // Layers will be a sorted list of icons/overlays, based on the order in which they are displayed var/list/layers = list() @@ -102,7 +102,7 @@ // Loop through the underlays, then overlays, sorting them into the layers list for(var/process_set in 0 to 1) var/list/process = process_set? A.overlays : A.underlays - for(var/i in 1 to process.len) + for(var/i in 1 to length(process)) var/image/current = process[i] if(!current) continue @@ -114,7 +114,7 @@ return flat current_layer = process_set + A.layer + current_layer / 1000 - for(var/p in 1 to layers.len) + for(var/p in 1 to length(layers)) var/image/cmp = layers[p] if(current_layer < layers[cmp]) layers.Insert(p, current) diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 025be39f3b4..affda69950a 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -266,7 +266,7 @@ DEFINE_BITFIELD(smoothing_junction, list( A.bottom_left_corner = se new_overlays += se - if(new_overlays.len) + if(length(new_overlays)) A.add_overlay(new_overlays) ///Scans direction to find targets to smooth with. diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 7a90a0543e5..cd6d5d8820b 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -101,9 +101,9 @@ //Returns list element or null. Should prevent "index out of bounds" error. /proc/listgetindex(list/list, index) - if(istype(list) && list.len) + if(istype(list) && length(list)) if(isnum(index)) - if(InRange(index,1,list.len)) + if(InRange(index,1,length(list))) return list[index] else if(index in list) return list[index] @@ -111,13 +111,13 @@ //Return either pick(list) or null if list is not of type /list or is empty /proc/safepick(list/list) - if(!islist(list) || !list.len) + if(!islist(list) || !length(list)) return return pick(list) //Checks if the list is empty /proc/isemptylist(list/list) - if(!list.len) + if(!length(list)) return 1 return 0 @@ -132,7 +132,7 @@ //Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches') /proc/is_type_in_typecache(atom/A, list/L) - if(!L || !L.len || !A) + if(!L || !length(L) || !A) return 0 return L[A.type] @@ -250,7 +250,7 @@ //Pick a random element from the list and remove it from the list. /proc/pick_n_take(list/listfrom) - if(listfrom.len > 0) + if(length(listfrom) > 0) var/picked = pick(listfrom) listfrom -= picked return picked @@ -275,12 +275,12 @@ //Returns the top(last) element from the list and removes it from the list (typical stack function) /proc/pop(list/L) - if(L.len) - . = L[L.len] + if(length(L)) + . = L[length(L)] L.len-- /proc/popleft(list/L) - if(L.len) + if(length(L)) . = L[1] L.Cut(1,2) @@ -293,7 +293,7 @@ /proc/reverselist(list/L) var/list/output = list() if(L) - for(var/i = L.len; i >= 1; i--) + for(var/i = length(L); i >= 1; i--) output += L[i] return output @@ -303,8 +303,8 @@ return L = L.Copy() - for(var/i=1, i sorted_text.len) + if(insert_index > length(sorted_text)) sorted_text += current_sort_text continue @@ -673,13 +673,13 @@ #define LAZYINITLIST(L) if(!L) { L = list() } -#define UNSETEMPTY(L) if(L && !L.len) L = null -#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } } +#define UNSETEMPTY(L) if(L && !length(L)) L = null +#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } } #define LAZYADD(L, I) if(!L) { L = list(); } L += I; #define LAZYOR(L, I) if(!L) { L = list(); } L |= I; /// Adds I to L, initializing L if necessary, if I is not already in L #define LAZYDISTINCTADD(L, I) if(!L) { L = list(); } L |= I; -#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null) +#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= length(L) ? L[I] : null) : L[I]) : null) #define LAZYLEN(L) length(L) // Despite how pointless this looks, it's still needed in order to convey that the list is specificially a 'Lazy' list. #define LAZYCLEARLIST(L) if(L) L.Cut() @@ -707,8 +707,8 @@ if(!L) return - for(var/i=1, i= 2) - fromIndex = fromIndex % L.len - toIndex = toIndex % (L.len + 1) + if(length(L) >= 2) + fromIndex = fromIndex % length(L) + toIndex = toIndex % (length(L) + 1) if(fromIndex <= 0) - fromIndex += L.len + fromIndex += length(L) if(toIndex <= 0) - toIndex += L.len + 1 + toIndex += length(L) + 1 var/datum/sortInstance/SI = GLOB.sortInstance if(!SI) diff --git a/code/__HELPERS/sorts/MergeSort.dm b/code/__HELPERS/sorts/MergeSort.dm index b6072842b68..0ce79909b5c 100644 --- a/code/__HELPERS/sorts/MergeSort.dm +++ b/code/__HELPERS/sorts/MergeSort.dm @@ -1,12 +1,12 @@ //merge-sort - gernerally faster than insert sort, for runs of 7 or larger /proc/sortMerge(list/L, cmp = GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex = 1, toIndex) - if(L && L.len >= 2) - fromIndex = fromIndex % L.len - toIndex = toIndex % (L.len + 1) + if(L && length(L) >= 2) + fromIndex = fromIndex % length(L) + toIndex = toIndex % (length(L) + 1) if(fromIndex <= 0) - fromIndex += L.len + fromIndex += length(L) if(toIndex <= 0) - toIndex += L.len + 1 + toIndex += length(L) + 1 var/datum/sortInstance/SI = GLOB.sortInstance if(!SI) diff --git a/code/__HELPERS/sorts/TimSort.dm b/code/__HELPERS/sorts/TimSort.dm index f71cb05b066..faf3e74aa7d 100644 --- a/code/__HELPERS/sorts/TimSort.dm +++ b/code/__HELPERS/sorts/TimSort.dm @@ -1,12 +1,12 @@ //TimSort interface /proc/sortTim(list/L, cmp = GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex = 1, toIndex = 0) - if(L && L.len >= 2) - fromIndex = fromIndex % L.len - toIndex = toIndex % (L.len + 1) + if(L && length(L) >= 2) + fromIndex = fromIndex % length(L) + toIndex = toIndex % (length(L) + 1) if(fromIndex <= 0) - fromIndex += L.len + fromIndex += length(L) if(toIndex <= 0) - toIndex += L.len + 1 + toIndex += length(L) + 1 var/datum/sortInstance/SI = GLOB.sortInstance if(!SI) diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index b5368330d59..6da4fc6e878 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -75,7 +75,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) //Merge all remaining runs to complete sort //ASSERT(start == end) mergeForceCollapse(); - //ASSERT(runBases.len == 1) + //ASSERT(length(runBases) == 1) //reset minGallop, for successive calls minGallop = MIN_GALLOP @@ -177,8 +177,8 @@ reverse a descending sequence without violating stability. //This method is called each time a new run is pushed onto the stack. //So the invariants are guaranteed to hold for i= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n - 1] <= runLens[n] + runLens[n + 1]) if(runLens[n - 1] < runLens[n + 1]) --n @@ -192,8 +192,8 @@ reverse a descending sequence without violating stability. //Merges all runs on the stack until only one remains. //Called only once, to finalise the sort /datum/sortInstance/proc/mergeForceCollapse() - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n - 1] < runLens[n + 1]) --n mergeAt(n) @@ -203,9 +203,9 @@ reverse a descending sequence without violating stability. //Run i must be the penultimate or antepenultimate run on the stack //In other words, i must be equal to stackSize-2 or stackSize-3 /datum/sortInstance/proc/mergeAt(i) - //ASSERT(runBases.len >= 2) + //ASSERT(length(runBases) >= 2) //ASSERT(i >= 1) - //ASSERT(i == runBases.len - 1 || i == runBases.len - 2) + //ASSERT(i == length(runBases) - 1 || i == length(runBases) - 2) var/base1 = runBases[i] var/base2 = runBases[i + 1] @@ -590,8 +590,8 @@ reverse a descending sequence without violating stability. while(remaining > 0) - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n - 1] <= runLens[n] + runLens[n + 1]) if(runLens[n - 1] < runLens[n + 1]) --n @@ -601,8 +601,8 @@ reverse a descending sequence without violating stability. else break //Invariant is established - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n - 1] < runLens[n + 1]) --n mergeAt2(n) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 9f8eb3e977f..1b20fdc1a89 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -553,9 +553,9 @@ if(tag == "img") var/list/img_props = splittext(arg, ";") - if(img_props.len == 3) + if(length(img_props) == 3) return "" - if(img_props.len == 2) + if(length(img_props) == 2) return "" return "" diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index b0aee0b08a4..f118fab395f 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -313,7 +313,7 @@ if(entry == null) return null matrix_list += entry - if(matrix_list.len < 6) + if(length(matrix_list) < 6) return null var/a = matrix_list[1] var/b = matrix_list[2] diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 6cf0868dd45..8af3de91da0 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -776,10 +776,10 @@ so as to remain in compliance with the most up-to-date laws." return FALSE var/icon_pref if(!hud_shown) - for(var/i in 1 to alerts.len) + for(var/i in 1 to length(alerts)) mymob.client.screen -= alerts[alerts[i]] return TRUE - for(var/i in 1 to alerts.len) + for(var/i in 1 to length(alerts)) var/atom/movable/screen/alert/alert = alerts[alerts[i]] if(alert.icon_state == "template") if(!icon_pref) diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index e52f6476ceb..501de75891e 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -90,9 +90,9 @@ GLOBAL_LIST_EMPTY(radial_menus) zone = 360 - starting_angle + ending_angle max_elements = round(zone / min_angle) - var/paged = max_elements < choices.len - if(elements.len < max_elements) - var/elements_to_add = max_elements - elements.len + var/paged = max_elements < length(choices) + if(length(elements) < max_elements) + var/elements_to_add = max_elements - length(elements) for(var/i in 1 to elements_to_add) //Create all elements var/atom/movable/screen/radial/new_element = new /atom/movable/screen/radial/slice new_element.parent = src @@ -102,18 +102,18 @@ GLOBAL_LIST_EMPTY(radial_menus) page_data = list(null) var/list/current = list() var/list/choices_left = choices.Copy() - while(choices_left.len) - if(current.len == max_elements) + while(length(choices_left)) + if(length(current) == max_elements) page_data[page] = current page++ page_data.len++ current = list() - if(paged && current.len == max_elements - 1) + if(paged && length(current) == max_elements - 1) current += NEXT_PAGE_ID continue else current += popleft(choices_left) - if(paged && current.len < max_elements) + if(paged && length(current) < max_elements) current += NEXT_PAGE_ID page_data[page] = current @@ -123,14 +123,14 @@ GLOBAL_LIST_EMPTY(radial_menus) /datum/radial_menu/proc/update_screen_objects() var/list/page_choices = page_data[current_page] - var/angle_per_element = round(zone / page_choices.len) + var/angle_per_element = round(zone / length(page_choices)) if(current_user.mob.z && anchor.z) pixel_x_difference = ((world.icon_size * anchor.x) + anchor.step_x + anchor.pixel_x) - ((world.icon_size * current_user.mob.x) + current_user.mob.step_x + current_user.mob.pixel_x) pixel_y_difference = ((world.icon_size * anchor.y) + anchor.step_y + anchor.pixel_y) - ((world.icon_size * current_user.mob.y) + current_user.mob.step_y + current_user.mob.pixel_y) - for(var/i in 1 to elements.len) + for(var/i in 1 to length(elements)) var/atom/movable/screen/radial/E = elements[i] var/angle = WRAP(starting_angle + (i - 1) * angle_per_element, 0, 360) - if(i > page_choices.len) + if(i > length(page_choices)) HideElement(E) else SetElement(E,page_choices[i], angle) @@ -187,10 +187,10 @@ GLOBAL_LIST_EMPTY(radial_menus) selected_choice = choices_values[choice_id] /datum/radial_menu/proc/get_next_id() - return "c_[choices.len]" + return "c_[length(choices)]" /datum/radial_menu/proc/set_choices(list/new_choices) - if(choices.len) + if(length(choices)) Reset() for(var/E in new_choices) var/id = get_next_id() diff --git a/code/_onclick/hud/robot_hud.dm b/code/_onclick/hud/robot_hud.dm index ae1e54f9fe2..b2c692dfc32 100644 --- a/code/_onclick/hud/robot_hud.dm +++ b/code/_onclick/hud/robot_hud.dm @@ -216,7 +216,7 @@ if(!R.robot_modules_background) return - var/display_rows = CEILING(R.module.modules.len / 8, 1) + var/display_rows = CEILING(length(R.module.modules) / 8, 1) R.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" R.client.screen += R.robot_modules_background diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 48c0664d740..bb041323527 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -204,7 +204,7 @@ return if(I in S.contents) // If the item is already in the storage, move them to the end of the list - if(S.contents[S.contents.len] == I) // No point moving them at the end if they're already there! + if(S.contents[length(S.contents)] == I) // No point moving them at the end if they're already there! return var/list/new_contents = S.contents.Copy() diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 0e789eacb89..17d9c8c54e4 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -145,7 +145,7 @@ if(I.discrete) return var/message_verb = "attacked" - if(I.attack_verb && I.attack_verb.len) + if(I.attack_verb && length(I.attack_verb)) message_verb = "[pick(I.attack_verb)]" else if(!I.force) return diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm index 3b448d91462..a10701fa538 100644 --- a/code/controllers/globals.dm +++ b/code/controllers/globals.dm @@ -52,10 +52,10 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) gvars_datum_init_order = list() gvars_datum_protected_varlist = list("gvars_datum_protected_varlist" = TRUE) var/list/global_procs = typesof(/datum/controller/global_vars/proc) - var/expected_len = vars.len - gvars_datum_in_built_vars.len - if(global_procs.len != expected_len) - warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!") - if(global_procs.len) + var/expected_len = length(vars) - length(gvars_datum_in_built_vars) + if(length(global_procs) != expected_len) + warning("Unable to detect all global initialization procs! Expected [expected_len] got [length(global_procs)]!") + if(length(global_procs)) var/list/expected_global_procs = vars - gvars_datum_in_built_vars for(var/I in global_procs) expected_global_procs -= replacetext("[I]", "InitGlobal", "") diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 4ecc06b54d3..5593027e482 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -332,9 +332,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/ss_runlevels = SS.runlevels var/added_to_any = FALSE - for(var/I in 1 to GLOB.bitflags.len) + for(var/I in 1 to length(GLOB.bitflags)) if(ss_runlevels & GLOB.bitflags[I]) - while(runlevel_sorted_subsystems.len < I) + while(length(runlevel_sorted_subsystems) < I) runlevel_sorted_subsystems += list(list()) runlevel_sorted_subsystems[I] += SS added_to_any = TRUE diff --git a/code/controllers/subsystem/SSacid.dm b/code/controllers/subsystem/SSacid.dm index 469cd7d06fc..6f470b451bc 100644 --- a/code/controllers/subsystem/SSacid.dm +++ b/code/controllers/subsystem/SSacid.dm @@ -25,8 +25,8 @@ SUBSYSTEM_DEF(acid) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/O = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/O = currentrun[length(currentrun)] currentrun.len-- if(!O || QDELETED(O)) processing -= O diff --git a/code/controllers/subsystem/SSafk.dm b/code/controllers/subsystem/SSafk.dm index b83f7d05d73..6bf0e99629e 100644 --- a/code/controllers/subsystem/SSafk.dm +++ b/code/controllers/subsystem/SSafk.dm @@ -86,7 +86,7 @@ SUBSYSTEM_DEF(afk) /datum/controller/subsystem/afk/proc/removeFromWatchList(list/toRemove) for(var/C in toRemove) - for(var/i in 1 to afk_players.len) + for(var/i in 1 to length(afk_players)) if(afk_players[i] == C) afk_players.Cut(i, i + 1) break diff --git a/code/controllers/subsystem/SSair.dm b/code/controllers/subsystem/SSair.dm index d5901824dc9..832b52cb571 100644 --- a/code/controllers/subsystem/SSair.dm +++ b/code/controllers/subsystem/SSair.dm @@ -59,13 +59,13 @@ SUBSYSTEM_DEF(air) msg += "DPN:[round(cost_deferred_pipenets,1)]|" msg += "AM:[round(cost_atmos_machinery,1)]" msg += "} " - msg += "AT:[active_turfs.len]|" - msg += "EG:[excited_groups.len]|" - msg += "HS:[hotspots.len]|" - msg += "PN:[networks.len]|" - msg += "HP:[high_pressure_delta.len]|" - msg += "AS:[active_super_conductivity.len]|" - msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]" + msg += "AT:[length(active_turfs)]|" + msg += "EG:[length(excited_groups)]|" + msg += "HS:[length(hotspots)]|" + msg += "PN:[length(networks)]|" + msg += "HP:[length(high_pressure_delta)]|" + msg += "AS:[length(active_super_conductivity)]|" + msg += "AT/MS:[round((cost ? length(active_turfs)/cost : 0),0.1)]" return msg.Join("") /datum/controller/subsystem/air/get_metrics() @@ -179,8 +179,8 @@ SUBSYSTEM_DEF(air) src.currentrun = deferred_pipenet_rebuilds.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/machinery/atmospherics/A = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/machinery/atmospherics/A = currentrun[length(currentrun)] currentrun.len-- if(A) A.build_network(remove_deferral = TRUE) @@ -194,8 +194,8 @@ SUBSYSTEM_DEF(air) src.currentrun = networks.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/datum/pipeline/thing = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/pipeline/thing = currentrun[length(currentrun)] currentrun.len-- if(thing) thing.process() @@ -210,8 +210,8 @@ SUBSYSTEM_DEF(air) src.currentrun = atmos_machinery.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/machinery/atmospherics/M = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/machinery/atmospherics/M = currentrun[length(currentrun)] currentrun.len-- if(!M || (M.process_atmos(seconds) == PROCESS_KILL)) atmos_machinery.Remove(M) @@ -223,8 +223,8 @@ SUBSYSTEM_DEF(air) src.currentrun = active_super_conductivity.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/turf/simulated/T = currentrun[currentrun.len] + while(length(currentrun)) + var/turf/simulated/T = currentrun[length(currentrun)] currentrun.len-- T.super_conduct() if(MC_TICK_CHECK) @@ -235,8 +235,8 @@ SUBSYSTEM_DEF(air) src.currentrun = hotspots.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/effect/hotspot/H = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/effect/hotspot/H = currentrun[length(currentrun)] currentrun.len-- if(H) H.process() @@ -246,8 +246,8 @@ SUBSYSTEM_DEF(air) return /datum/controller/subsystem/air/proc/process_high_pressure_delta(resumed = 0) - while(high_pressure_delta.len) - var/turf/simulated/T = high_pressure_delta[high_pressure_delta.len] + while(length(high_pressure_delta)) + var/turf/simulated/T = high_pressure_delta[length(high_pressure_delta)] high_pressure_delta.len-- T.high_pressure_movements() T.pressure_difference = 0 @@ -261,8 +261,8 @@ SUBSYSTEM_DEF(air) src.currentrun = active_turfs.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/turf/simulated/T = currentrun[currentrun.len] + while(length(currentrun)) + var/turf/simulated/T = currentrun[length(currentrun)] currentrun.len-- if(T) T.process_cell(fire_count) @@ -274,8 +274,8 @@ SUBSYSTEM_DEF(air) src.currentrun = excited_groups.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/datum/excited_group/EG = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/excited_group/EG = currentrun[length(currentrun)] currentrun.len-- EG.breakdown_cooldown++ if(EG.breakdown_cooldown == 10) diff --git a/code/controllers/subsystem/SSblackbox.dm b/code/controllers/subsystem/SSblackbox.dm index 6cc8f9c7141..cdd10077d26 100644 --- a/code/controllers/subsystem/SSblackbox.dm +++ b/code/controllers/subsystem/SSblackbox.dm @@ -68,10 +68,10 @@ SUBSYSTEM_DEF(blackbox) /datum/controller/subsystem/blackbox/Shutdown() sealed = FALSE for(var/obj/machinery/message_server/MS in GLOB.message_servers) - if(MS.pda_msgs.len) - record_feedback("tally", "radio_usage", MS.pda_msgs.len, "PDA") - if(MS.rc_msgs.len) - record_feedback("tally", "radio_usage", MS.rc_msgs.len, "request console") + if(length(MS.pda_msgs)) + record_feedback("tally", "radio_usage", length(MS.pda_msgs), "PDA") + if(length(MS.rc_msgs)) + record_feedback("tally", "radio_usage", length(MS.rc_msgs), "request console") if(length(research_levels)) record_feedback("associative", "high_research_level", 1, research_levels) @@ -248,7 +248,7 @@ SUBSYSTEM_DEF(blackbox) * * depth - Depth to use */ /datum/controller/subsystem/blackbox/proc/record_feedback_recurse_list(list/L, list/key_list, increment, depth = 1) - if(depth == key_list.len) + if(depth == length(key_list)) if(L.Find(key_list[depth])) L["[key_list[depth]]"] += increment else diff --git a/code/controllers/subsystem/SSfires.dm b/code/controllers/subsystem/SSfires.dm index f811713e632..c98d7f01d5d 100644 --- a/code/controllers/subsystem/SSfires.dm +++ b/code/controllers/subsystem/SSfires.dm @@ -26,8 +26,8 @@ SUBSYSTEM_DEF(fires) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/O = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/O = currentrun[length(currentrun)] currentrun.len-- if(!O || QDELETED(O)) processing -= O diff --git a/code/controllers/subsystem/SSgarbage.dm b/code/controllers/subsystem/SSgarbage.dm index f567255f703..638baeae543 100644 --- a/code/controllers/subsystem/SSgarbage.dm +++ b/code/controllers/subsystem/SSgarbage.dm @@ -275,7 +275,7 @@ SUBSYSTEM_DEF(garbage) /datum/controller/subsystem/garbage/Recover() InitQueues() //We first need to create the queues before recovering data if(istype(SSgarbage.queues)) - for(var/i in 1 to SSgarbage.queues.len) + for(var/i in 1 to length(SSgarbage.queues)) queues[i] |= SSgarbage.queues[i] diff --git a/code/controllers/subsystem/SSicon_smooth.dm b/code/controllers/subsystem/SSicon_smooth.dm index 5513d9152d8..1b33f458dad 100644 --- a/code/controllers/subsystem/SSicon_smooth.dm +++ b/code/controllers/subsystem/SSicon_smooth.dm @@ -10,13 +10,13 @@ SUBSYSTEM_DEF(icon_smooth) var/list/smooth_queue = list() /datum/controller/subsystem/icon_smooth/fire() - while(smooth_queue.len) - var/atom/A = smooth_queue[smooth_queue.len] + while(length(smooth_queue)) + var/atom/A = smooth_queue[length(smooth_queue)] smooth_queue.len-- A.smooth_icon() if(MC_TICK_CHECK) return - if(!smooth_queue.len) + if(!length(smooth_queue)) can_fire = 0 /datum/controller/subsystem/icon_smooth/Initialize() diff --git a/code/controllers/subsystem/SSidlenpcpool.dm b/code/controllers/subsystem/SSidlenpcpool.dm index b5c52f23ae6..c424950791e 100644 --- a/code/controllers/subsystem/SSidlenpcpool.dm +++ b/code/controllers/subsystem/SSidlenpcpool.dm @@ -24,8 +24,8 @@ SUBSYSTEM_DEF(idlenpcpool) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/mob/living/simple_animal/SA = currentrun[currentrun.len] + while(length(currentrun)) + var/mob/living/simple_animal/SA = currentrun[length(currentrun)] --currentrun.len if(!SA) log_debug("idlenpcpool encountered an invalid entry, resumed: [resumed], SA [SA], type of SA [SA?.type], null [SA == null], qdelled [QDELETED(SA)], SA in AI_IDLE list: [SA in GLOB.simple_animals[AI_IDLE]]") diff --git a/code/controllers/subsystem/SSjobs.dm b/code/controllers/subsystem/SSjobs.dm index 5b2d10876b0..5996c84737e 100644 --- a/code/controllers/subsystem/SSjobs.dm +++ b/code/controllers/subsystem/SSjobs.dm @@ -44,7 +44,7 @@ SUBSYSTEM_DEF(jobs) /datum/controller/subsystem/jobs/proc/SetupOccupations(list/faction = list("Station")) occupations = list() var/list/all_jobs = subtypesof(/datum/job) - if(!all_jobs.len) + if(!length(all_jobs)) to_chat(world, "Error setting up jobs, no job datums found.") return 0 @@ -63,12 +63,12 @@ SUBSYSTEM_DEF(jobs) job_debug.Add(text) /datum/controller/subsystem/jobs/proc/GetJob(rank) - if(!occupations.len) + if(!length(occupations)) SetupOccupations() return name_occupations[rank] /datum/controller/subsystem/jobs/proc/GetJobType(jobtype) - if(!occupations.len) + if(!length(occupations)) SetupOccupations() return type_occupations[jobtype] @@ -235,7 +235,7 @@ SUBSYSTEM_DEF(jobs) if(!job) continue var/list/candidates = FindOccupationCandidates(job, level) - if(!candidates.len) + if(!length(candidates)) continue var/list/filteredCandidates = list() @@ -246,7 +246,7 @@ SUBSYSTEM_DEF(jobs) continue filteredCandidates += V - if(!filteredCandidates.len) + if(!length(filteredCandidates)) continue var/mob/new_player/candidate = pick(filteredCandidates) @@ -263,7 +263,7 @@ SUBSYSTEM_DEF(jobs) if(!job) continue var/list/candidates = FindOccupationCandidates(job, level) - if(!candidates.len) + if(!length(candidates)) continue var/mob/new_player/candidate = pick(candidates) AssignRole(candidate, command_position) @@ -282,7 +282,7 @@ SUBSYSTEM_DEF(jobs) for(var/level = 1 to 3) var/list/candidates = list() candidates = FindOccupationCandidates(job, level) - if(candidates.len) + if(length(candidates)) var/mob/new_player/candidate = pick(candidates) if(AssignRole(candidate, "AI")) ai_selected++ @@ -317,7 +317,7 @@ SUBSYSTEM_DEF(jobs) if(player.ready && player.mind && !player.mind.assigned_role) unassigned += player - Debug("DO, Len: [unassigned.len]") + Debug("DO, Len: [length(unassigned)]") if(!length(unassigned)) return FALSE @@ -330,7 +330,7 @@ SUBSYSTEM_DEF(jobs) Debug("DO, Running Assistant Check 1") var/datum/job/ast = new /datum/job/assistant() var/list/assistant_candidates = FindOccupationCandidates(ast, 3) - Debug("AC1, Candidates: [assistant_candidates.len]") + Debug("AC1, Candidates: [length(assistant_candidates)]") for(var/mob/new_player/player in assistant_candidates) Debug("AC1 pass, Player: [player]") AssignRole(player, "Assistant") diff --git a/code/controllers/subsystem/SSmachinery.dm b/code/controllers/subsystem/SSmachinery.dm index b625979eae5..e17cf6ec8d6 100644 --- a/code/controllers/subsystem/SSmachinery.dm +++ b/code/controllers/subsystem/SSmachinery.dm @@ -39,15 +39,15 @@ SUBSYSTEM_DEF(machines) propagate_network(PC, PC.powernet) /datum/controller/subsystem/machines/get_stat_details() - return "Machines: [processing.len] | Powernets: [powernets.len] | Deferred: [deferred_powernet_rebuilds.len]" + return "Machines: [length(processing)] | Powernets: [length(powernets)] | Deferred: [length(deferred_powernet_rebuilds)]" /datum/controller/subsystem/machines/proc/process_defered_powernets(resumed = 0) if(!resumed) src.currentrun = deferred_powernet_rebuilds.Copy() //cache for sanid speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/O = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/O = currentrun[length(currentrun)] currentrun.len-- if(O && !QDELETED(O)) var/datum/regional_powernet/newPN = new() // create a new powernet... @@ -62,8 +62,8 @@ SUBSYSTEM_DEF(machines) src.currentrun = powernets.Copy() //cache for sanid speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/datum/regional_powernet/P = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/regional_powernet/P = currentrun[length(currentrun)] currentrun.len-- if(P) P.process_power() // reset the power state @@ -78,8 +78,8 @@ SUBSYSTEM_DEF(machines) src.currentrun = processing.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/obj/machinery/thing = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/machinery/thing = currentrun[length(currentrun)] currentrun.len-- if(!QDELETED(thing) && thing.process(seconds) != PROCESS_KILL) if(prob(MACHINE_FLICKER_CHANCE)) diff --git a/code/controllers/subsystem/SSmobs.dm b/code/controllers/subsystem/SSmobs.dm index 537683f1d60..1a3683937b3 100644 --- a/code/controllers/subsystem/SSmobs.dm +++ b/code/controllers/subsystem/SSmobs.dm @@ -35,8 +35,8 @@ SUBSYSTEM_DEF(mobs) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun var/times_fired = src.times_fired - while(currentrun.len) - var/mob/living/L = currentrun[currentrun.len] + while(length(currentrun)) + var/mob/living/L = currentrun[length(currentrun)] currentrun.len-- if(L) L.Life(seconds, times_fired) diff --git a/code/controllers/subsystem/SSnano_mob_hunter.dm b/code/controllers/subsystem/SSnano_mob_hunter.dm index 49b433ca6b0..93e622f3ae1 100644 --- a/code/controllers/subsystem/SSnano_mob_hunter.dm +++ b/code/controllers/subsystem/SSnano_mob_hunter.dm @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(mob_hunt) if(!server_status) return client_mob_update() - if(normal_spawns.len < max_normal_spawns) + if(length(normal_spawns) < max_normal_spawns) spawn_mob() //leaving this here in case admins want to use it for a random mini-event or something @@ -51,7 +51,7 @@ SUBSYSTEM_DEF(mob_hunt) if(!H || H != connected_clients[client]) ex_players |= connected_clients[client] connected_clients[client] = H - if(ex_players.len) //to make sure we don't do this if we didn't lose any player since the last update + if(length(ex_players)) //to make sure we don't do this if we didn't lose any player since the last update for(var/obj/effect/nanomob/N in (normal_spawns + trap_spawns)) N.conceal(ex_players) @@ -59,7 +59,7 @@ SUBSYSTEM_DEF(mob_hunt) if(server_status != 0) return server_status = 1 - while(normal_spawns.len < max_normal_spawns) //repopulate the server's spawns completely if we auto-recover from crash + while(length(normal_spawns) < max_normal_spawns) //repopulate the server's spawns completely if we auto-recover from crash spawn_mob() /datum/controller/subsystem/mob_hunt/proc/manual_reboot() @@ -94,7 +94,7 @@ SUBSYSTEM_DEF(mob_hunt) var/obj/effect/nanomob/new_mob = new /obj/effect/nanomob(mob_info.spawn_point, mob_info) trap_spawns += new_mob new_mob.reveal() - if(trap_spawns.len > max_trap_spawns) + if(length(trap_spawns) > max_trap_spawns) var/obj/effect/nanomob/old_trap = trap_spawns[1] old_trap.despawn() return 1 diff --git a/code/controllers/subsystem/SSnpcpool.dm b/code/controllers/subsystem/SSnpcpool.dm index ca9c3befbee..8e17b860ac7 100644 --- a/code/controllers/subsystem/SSnpcpool.dm +++ b/code/controllers/subsystem/SSnpcpool.dm @@ -18,8 +18,8 @@ SUBSYSTEM_DEF(npcpool) var/list/currentrun = src.currentrun - while(currentrun.len) - var/mob/living/simple_animal/SA = currentrun[currentrun.len] + while(length(currentrun)) + var/mob/living/simple_animal/SA = currentrun[length(currentrun)] --currentrun.len if(!SA) log_debug("npcpool encountered an invalid entry, resumed: [resumed], SA [SA], type of SA [SA?.type], null [SA == null], qdelled [QDELETED(SA)], SA in AI_ON list: [SA in GLOB.simple_animals[AI_ON]]") diff --git a/code/controllers/subsystem/SSoverlays.dm b/code/controllers/subsystem/SSoverlays.dm index dad9c3683cf..ed3382382c9 100644 --- a/code/controllers/subsystem/SSoverlays.dm +++ b/code/controllers/subsystem/SSoverlays.dm @@ -113,7 +113,7 @@ SUBSYSTEM_DEF(overlays) priority_overlays.Cut() //If not already queued for work and there are overlays to remove - if(NOT_QUEUED_ALREADY && remove_overlays.len) + if(NOT_QUEUED_ALREADY && length(remove_overlays)) QUEUE_FOR_COMPILE /atom/proc/cut_overlay(list/overlays, priority) @@ -123,9 +123,9 @@ SUBSYSTEM_DEF(overlays) LAZYINITLIST(add_overlays) //always initialized after this point LAZYINITLIST(priority_overlays) LAZYINITLIST(remove_overlays) - var/a_len = add_overlays.len - var/r_len = remove_overlays.len - var/p_len = priority_overlays.len + var/a_len = length(add_overlays) + var/r_len = length(remove_overlays) + var/p_len = length(priority_overlays) remove_overlays += overlays add_overlays -= overlays @@ -133,9 +133,9 @@ SUBSYSTEM_DEF(overlays) var/list/cached_priority = priority_overlays LAZYREMOVE(cached_priority, overlays) - var/fa_len = add_overlays.len - var/fr_len = remove_overlays.len - var/fp_len = priority_overlays.len + var/fa_len = length(add_overlays) + var/fr_len = length(remove_overlays) + var/fp_len = length(priority_overlays) //If not already queued and there is work to be done if(NOT_QUEUED_ALREADY && (fa_len != a_len || fr_len != r_len || fp_len != p_len)) @@ -149,17 +149,17 @@ SUBSYSTEM_DEF(overlays) LAZYINITLIST(add_overlays) //always initialized after this point LAZYINITLIST(priority_overlays) - var/a_len = add_overlays.len - var/p_len = priority_overlays.len + var/a_len = length(add_overlays) + var/p_len = length(priority_overlays) if(priority) priority_overlays += overlays //or in the image. Can we use [image] = image? - var/fp_len = priority_overlays.len + var/fp_len = length(priority_overlays) if(NOT_QUEUED_ALREADY && fp_len != p_len) QUEUE_FOR_COMPILE else add_overlays += overlays - var/fa_len = add_overlays.len + var/fa_len = length(add_overlays) if(NOT_QUEUED_ALREADY && fa_len != a_len) QUEUE_FOR_COMPILE @@ -200,7 +200,7 @@ SUBSYSTEM_DEF(overlays) var/list/cached_other = other.overlays.Copy() if(cached_other) - if(cut_old || !overlays.len) + if(cut_old || !length(overlays)) overlays = cached_other else overlays |= cached_other diff --git a/code/controllers/subsystem/SSparallax.dm b/code/controllers/subsystem/SSparallax.dm index 99024fd0d1e..60637955cdf 100644 --- a/code/controllers/subsystem/SSparallax.dm +++ b/code/controllers/subsystem/SSparallax.dm @@ -31,7 +31,7 @@ SUBSYSTEM_DEF(parallax) var/list/currentrun = src.currentrun while(length(currentrun)) - var/client/C = currentrun[currentrun.len] + var/client/C = currentrun[length(currentrun)] currentrun.len-- if(!C || !C.eye) if(MC_TICK_CHECK) diff --git a/code/controllers/subsystem/SSping.dm b/code/controllers/subsystem/SSping.dm index 42df890f9b7..5e95309b8e3 100644 --- a/code/controllers/subsystem/SSping.dm +++ b/code/controllers/subsystem/SSping.dm @@ -27,7 +27,7 @@ SUBSYSTEM_DEF(ping) var/list/current_run = src.current_run while(length(current_run)) - var/client/client = current_run[current_run.len] + var/client/client = current_run[length(current_run)] current_run.len-- if(client?.tgui_panel?.is_ready()) diff --git a/code/controllers/subsystem/SSshuttles.dm b/code/controllers/subsystem/SSshuttles.dm index d4b921f36eb..5e5a92bdb05 100644 --- a/code/controllers/subsystem/SSshuttles.dm +++ b/code/controllers/subsystem/SSshuttles.dm @@ -246,7 +246,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/get_dock_overlap(x0, y0, x1, y1, z) . = list() var/list/stationary_cache = stationary - for(var/i in 1 to stationary_cache.len) + for(var/i in 1 to length(stationary_cache)) var/obj/docking_port/port = stationary_cache[i] if(!port || port.z != z) continue @@ -254,7 +254,7 @@ SUBSYSTEM_DEF(shuttle) var/list/overlap = get_overlap(x0, y0, x1, y1, bounds[1], bounds[2], bounds[3], bounds[4]) var/list/xs = overlap[1] var/list/ys = overlap[2] - if(xs.len && ys.len) + if(length(xs) && length(ys)) .[port] = overlap /datum/controller/subsystem/shuttle/proc/update_hidden_docking_ports(list/remove_turfs, list/add_turfs) @@ -272,7 +272,7 @@ SUBSYSTEM_DEF(shuttle) for(var/V in add_turfs) var/turf/T = V var/image/I - if(remove_images.len) + if(length(remove_images)) //we can just reuse any images we are about to delete instead of making new ones I = remove_images[1] remove_images.Cut(1, 2) diff --git a/code/controllers/subsystem/SSspacedrift.dm b/code/controllers/subsystem/SSspacedrift.dm index 96aa68a8e2a..cb489b55c2a 100644 --- a/code/controllers/subsystem/SSspacedrift.dm +++ b/code/controllers/subsystem/SSspacedrift.dm @@ -26,8 +26,8 @@ SUBSYSTEM_DEF(spacedrift) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/atom/movable/AM = currentrun[currentrun.len] + while(length(currentrun)) + var/atom/movable/AM = currentrun[length(currentrun)] currentrun.len-- if(!AM) processing -= AM diff --git a/code/controllers/subsystem/SStgui.dm b/code/controllers/subsystem/SStgui.dm index 924a5f02919..d84c486c615 100644 --- a/code/controllers/subsystem/SStgui.dm +++ b/code/controllers/subsystem/SStgui.dm @@ -42,8 +42,8 @@ SUBSYSTEM_DEF(tgui) src.current_run = open_uis.Copy() // Cache for sanic speed (lists are references anyways) var/list/current_run = src.current_run - while(current_run.len) - var/datum/tgui/ui = current_run[current_run.len] + while(length(current_run)) + var/datum/tgui/ui = current_run[length(current_run)] current_run.len-- // TODO: Move user/src_object check to process() if(ui && ui.user && ui.src_object) diff --git a/code/controllers/subsystem/SSthrowing.dm b/code/controllers/subsystem/SSthrowing.dm index 621c5020028..3e4bc1536ff 100644 --- a/code/controllers/subsystem/SSthrowing.dm +++ b/code/controllers/subsystem/SSthrowing.dm @@ -30,7 +30,7 @@ SUBSYSTEM_DEF(throwing) var/list/currentrun = src.currentrun while(length(currentrun)) - var/atom/movable/AM = currentrun[currentrun.len] + var/atom/movable/AM = currentrun[length(currentrun)] var/datum/thrownthing/TT = currentrun[AM] currentrun.len-- if(!AM || !TT) diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index 91c37f28a0c..6a9bd55d688 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -529,9 +529,9 @@ SUBSYSTEM_DEF(ticker) else var/list/randomtips = file2list("strings/tips.txt") var/list/memetips = file2list("strings/sillytips.txt") - if(randomtips.len && prob(95)) + if(length(randomtips) && prob(95)) m = pick(randomtips) - else if(memetips.len) + else if(length(memetips)) m = pick(memetips) if(m) @@ -706,8 +706,8 @@ SUBSYSTEM_DEF(ticker) for(var/loc_type in subtypesof(/datum/trade_destination)) var/datum/trade_destination/D = new loc_type - GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len - GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + GLOB.weighted_randomevent_locations[D] = length(D.viable_random_events) + GLOB.weighted_mundaneevent_locations[D] = length(D.viable_mundane_events) // Easy handler to make rebooting the world not a massive sleep in world/Reboot() /datum/controller/subsystem/ticker/proc/reboot_helper(reason, end_string, delay) diff --git a/code/controllers/subsystem/non_firing/SSatoms.dm b/code/controllers/subsystem/non_firing/SSatoms.dm index 4226c93f98d..a1c515fdb80 100644 --- a/code/controllers/subsystem/non_firing/SSatoms.dm +++ b/code/controllers/subsystem/non_firing/SSatoms.dm @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(atoms) var/count var/list/mapload_arg = list(TRUE) if(atoms) - count = atoms.len + count = length(atoms) for(var/I in atoms) var/atom/A = I if(A && !A.initialized) @@ -58,7 +58,7 @@ SUBSYSTEM_DEF(atoms) initialized = INITIALIZATION_INNEW_REGULAR - if(late_loaders.len) + if(length(late_loaders)) watch = start_watch() if(noisy) log_startup_progress("Late-initializing atoms...") diff --git a/code/controllers/subsystem/non_firing/SSmapping.dm b/code/controllers/subsystem/non_firing/SSmapping.dm index c73d53da322..34870242284 100644 --- a/code/controllers/subsystem/non_firing/SSmapping.dm +++ b/code/controllers/subsystem/non_firing/SSmapping.dm @@ -203,7 +203,7 @@ SUBSYSTEM_DEF(mapping) log_startup_progress("Loaded Lavaland in [stop_watch(watch)]s") /datum/controller/subsystem/mapping/proc/seedRuins(list/z_levels = null, budget = 0, whitelist = /area/space, list/potentialRuins) - if(!z_levels || !z_levels.len) + if(!z_levels || !length(z_levels)) WARNING("No Z levels provided - Not generating ruins") return @@ -230,10 +230,10 @@ SUBSYSTEM_DEF(mapping) continue ruins_availible[R] = R.placement_weight - while(budget > 0 && (ruins_availible.len || forced_ruins.len)) + while(budget > 0 && (length(ruins_availible) || length(forced_ruins))) var/datum/map_template/ruin/current_pick var/forced = FALSE - if(forced_ruins.len) //We have something we need to load right now, so just pick it + if(length(forced_ruins)) //We have something we need to load right now, so just pick it for(var/ruin in forced_ruins) current_pick = ruin if(forced_ruins[ruin] > 0) //Load into designated z diff --git a/code/controllers/subsystem/non_firing/SSradio.dm b/code/controllers/subsystem/non_firing/SSradio.dm index 402fc3375c6..e17bc1e42d1 100644 --- a/code/controllers/subsystem/non_firing/SSradio.dm +++ b/code/controllers/subsystem/non_firing/SSradio.dm @@ -85,7 +85,7 @@ SUBSYSTEM_DEF(radio) if(frequency) frequency.remove_listener(device) - if(frequency.devices.len == 0) + if(length(frequency.devices) == 0) qdel(frequency) frequencies -= f_text diff --git a/code/controllers/subsystem/non_firing/SStitlescreen.dm b/code/controllers/subsystem/non_firing/SStitlescreen.dm index 100dff90cda..6591e67dd4f 100644 --- a/code/controllers/subsystem/non_firing/SStitlescreen.dm +++ b/code/controllers/subsystem/non_firing/SStitlescreen.dm @@ -10,10 +10,10 @@ SUBSYSTEM_DEF(title) for(var/S in provisional_title_screens) var/list/L = splittext(S,"+") - if(L.len == 1 && L[1] != "blank.png") + if(length(L) == 1 && L[1] != "blank.png") title_screens += S - else if(L.len > 1) + else if(length(L) > 1) if(use_rare_screens && lowertext(L[1]) == "rare") title_screens += S @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(title) if(length(title_screens) > 1) for(var/S in title_screens) var/list/L = splittext(S,".") - if(L.len != 2 || L[1] != "default") + if(length(L) != 2 || L[1] != "default") continue title_screens -= S break diff --git a/code/controllers/subsystem/processing/processing.dm b/code/controllers/subsystem/processing/processing.dm index 14ab39fdcdf..1abc4b89116 100644 --- a/code/controllers/subsystem/processing/processing.dm +++ b/code/controllers/subsystem/processing/processing.dm @@ -26,8 +26,8 @@ SUBSYSTEM_DEF(processing) //cache for sanic speed (lists are references anyways) var/list/current_run = currentrun - while(current_run.len) - var/datum/thing = current_run[current_run.len] + while(length(current_run)) + var/datum/thing = current_run[length(current_run)] current_run.len-- if(QDELETED(thing)) processing -= thing diff --git a/code/controllers/subsystem/tickets/tickets.dm b/code/controllers/subsystem/tickets/tickets.dm index 444ca63d063..7cf79bae006 100644 --- a/code/controllers/subsystem/tickets/tickets.dm +++ b/code/controllers/subsystem/tickets/tickets.dm @@ -334,7 +334,7 @@ SUBSYSTEM_DEF(tickets) for(var/datum/ticket/T in allTickets) if(T.client_ckey == C.ckey && (T.ticketState == TICKET_OPEN || T.ticketState == TICKET_STALE)) tickets += T - if(tickets.len) + if(length(tickets)) return tickets return FALSE diff --git a/code/datums/ai_laws_datums.dm b/code/datums/ai_laws_datums.dm index c844b72657d..dd9e29fbb93 100644 --- a/code/datums/ai_laws_datums.dm +++ b/code/datums/ai_laws_datums.dm @@ -53,7 +53,7 @@ return statements /datum/ai_laws/proc/sort_laws() - if(sorted_laws.len) + if(length(sorted_laws)) return if(zeroth_law) @@ -65,7 +65,7 @@ var/index = 1 for(var/datum/ai_law/inherent_law in inherent_laws) inherent_law.index = index++ - if(supplied_laws.len < inherent_law.index || !istype(supplied_laws[inherent_law.index], /datum/ai_law)) + if(length(supplied_laws) < inherent_law.index || !istype(supplied_laws[inherent_law.index], /datum/ai_law)) sorted_laws += inherent_law for(var/datum/ai_law/AL in supplied_laws) @@ -77,11 +77,11 @@ if(change_zeroth) S.sync_zeroth(zeroth_law, zeroth_law_borg) - if(full_sync || ion_laws.len) + if(full_sync || length(ion_laws)) S.laws.clear_ion_laws() - if(full_sync || inherent_laws.len) + if(full_sync || length(inherent_laws)) S.laws.clear_inherent_laws() - if(full_sync || supplied_laws.len) + if(full_sync || length(supplied_laws)) S.laws.clear_supplied_laws() for(var/datum/ai_law/law in ion_laws) @@ -130,7 +130,7 @@ var/new_law = new/datum/ai_law/ion(law) ion_laws += new_law - if(state_ion.len < ion_laws.len) + if(length(state_ion) < length(ion_laws)) state_ion += 1 sorted_laws.Cut() @@ -145,7 +145,7 @@ var/new_law = new/datum/ai_law/inherent(law) inherent_laws += new_law - if(state_inherent.len < inherent_laws.len) + if(length(state_inherent) < length(inherent_laws)) state_inherent += 1 sorted_laws.Cut() @@ -154,22 +154,22 @@ if(!law) return - if(supplied_laws.len >= number) + if(length(supplied_laws) >= number) var/datum/ai_law/existing_law = supplied_laws[number] if(existing_law && existing_law.law == law) return - if(supplied_laws.len >= number && supplied_laws[number]) + if(length(supplied_laws) >= number && supplied_laws[number]) delete_law(supplied_laws[number]) - while(src.supplied_laws.len < number) + while(length(src.supplied_laws) < number) src.supplied_laws += "" - if(state_supplied.len < supplied_laws.len) + if(length(state_supplied) < length(supplied_laws)) state_supplied += 1 var/new_law = new/datum/ai_law/supplied(law, number) supplied_laws[number] = new_law - if(state_supplied.len < supplied_laws.len) + if(length(state_supplied) < length(supplied_laws)) state_supplied += 1 sorted_laws.Cut() @@ -203,7 +203,7 @@ var/index = laws.Find(law) if(index) laws -= law - for(index, index < state.len, index++) + for(index, index < length(state), index++) state[index] = state[index+1] sorted_laws.Cut() diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 5b3cd3a53db..fffa11ef74d 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -102,7 +102,7 @@ components_of_type = test if(I == our_type) //exact match, take priority var/inserted = FALSE - for(var/J in 1 to components_of_type.len) + for(var/J in 1 to length(components_of_type)) var/datum/component/C = components_of_type[J] if(C.type != our_type) //but not over other exact matches components_of_type.Insert(J, I) @@ -127,13 +127,13 @@ var/list/components_of_type = dc[I] if(length(components_of_type)) // var/list/subtracted = components_of_type - src - if(subtracted.len == 1) //only 1 guy left + if(length(subtracted) == 1) //only 1 guy left dc[I] = subtracted[1] //make him special else dc[I] = subtracted else //just us dc -= I - if(!dc.len) + if(!length(dc)) P.datum_components = null UnregisterFromParent() @@ -241,7 +241,7 @@ lookup[sig] -= src signal_procs[target] -= sig_type_or_types - if(!signal_procs[target].len) + if(!length(signal_procs[target])) signal_procs -= target /// Registers multiple signals to the same proc. diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index 42d9731dbc0..6041460d068 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -184,7 +184,7 @@ //For consuming material //mats is a list of types of material to use and the corresponding amounts, example: list(MAT_METAL=100, MAT_GLASS=200) /datum/component/material_container/proc/use_amount(list/mats, multiplier=1) - if(!mats || !mats.len) + if(!mats || !length(mats)) return FALSE var/datum/material/M @@ -292,7 +292,7 @@ return (total_amount + amt) <= max_amount /datum/component/material_container/proc/has_materials(list/mats, multiplier=1) - if(!mats || !mats.len) + if(!mats || !length(mats)) return FALSE var/datum/material/M diff --git a/code/datums/components/spawner.dm b/code/datums/components/spawner.dm index 9780db16407..b1d6e867975 100644 --- a/code/datums/components/spawner.dm +++ b/code/datums/components/spawner.dm @@ -39,7 +39,7 @@ /datum/component/spawner/proc/try_spawn_mob() var/atom/P = parent - if(spawned_mobs.len >= max_mobs) + if(length(spawned_mobs) >= max_mobs) return 0 if(spawn_delay > world.time) return 0 diff --git a/code/datums/components/swarming.dm b/code/datums/components/swarming.dm index ac81ea6aefa..928589fbaaa 100644 --- a/code/datums/components/swarming.dm +++ b/code/datums/components/swarming.dm @@ -17,7 +17,7 @@ for(var/other in swarm_members) var/datum/component/swarming/other_swarm = other other_swarm.swarm_members -= src - if(!other_swarm.swarm_members.len) + if(!length(other_swarm.swarm_members)) other_swarm.unswarm() swarm_members = null return ..() @@ -36,10 +36,10 @@ if(!other_swarm || !(other_swarm in swarm_members)) return swarm_members -= other_swarm - if(!swarm_members.len) + if(!length(swarm_members)) unswarm() other_swarm.swarm_members -= src - if(!other_swarm.swarm_members.len) + if(!length(other_swarm.swarm_members)) other_swarm.unswarm() /datum/component/swarming/proc/swarm() diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index e74385de46c..c56c4a1e275 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -15,7 +15,7 @@ using /datum/datacore/proc/manifest_inject(), or manifest_insert() GLOBAL_LIST_EMPTY(PDA_Manifest) /datum/datacore/proc/get_manifest_json() - if(GLOB.PDA_Manifest.len) + if(length(GLOB.PDA_Manifest)) return var/heads[0] var/sec[0] @@ -38,44 +38,44 @@ GLOBAL_LIST_EMPTY(PDA_Manifest) heads[++heads.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 depthead = 1 - if(rank == "Captain" && heads.len != 1) - heads.Swap(1, heads.len) + if(rank == "Captain" && length(heads) != 1) + heads.Swap(1, length(heads)) if(real_rank in GLOB.active_security_positions) sec[++sec.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && sec.len != 1) - sec.Swap(1, sec.len) + if(depthead && length(sec) != 1) + sec.Swap(1, length(sec)) if(real_rank in GLOB.engineering_positions) eng[++eng.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && eng.len != 1) - eng.Swap(1, eng.len) + if(depthead && length(eng) != 1) + eng.Swap(1, length(eng)) if(real_rank in GLOB.medical_positions) med[++med.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && med.len != 1) - med.Swap(1, med.len) + if(depthead && length(med) != 1) + med.Swap(1, length(med)) if(real_rank in GLOB.science_positions) sci[++sci.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && sci.len != 1) - sci.Swap(1, sci.len) + if(depthead && length(sci) != 1) + sci.Swap(1, length(sci)) if(real_rank in GLOB.service_positions) ser[++ser.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && ser.len != 1) - ser.Swap(1, ser.len) + if(depthead && length(ser) != 1) + ser.Swap(1, length(ser)) if(real_rank in GLOB.supply_positions) sup[++sup.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 - if(depthead && sup.len != 1) - sup.Swap(1, sup.len) + if(depthead && length(sup) != 1) + sup.Swap(1, length(sup)) if(real_rank in GLOB.nonhuman_positions) bot[++bot.len] = list("name" = name, "rank" = rank, "active" = isactive) @@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest) manifest_inject(H) /datum/datacore/proc/manifest_modify(name, assignment) - if(GLOB.PDA_Manifest.len) + if(length(GLOB.PDA_Manifest)) GLOB.PDA_Manifest.Cut() var/datum/data/record/foundrecord var/real_title = assignment @@ -137,7 +137,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest) GLOBAL_VAR_INIT(record_id_num, 1001) /datum/datacore/proc/manifest_inject(mob/living/carbon/human/H) - if(GLOB.PDA_Manifest.len) + if(length(GLOB.PDA_Manifest)) GLOB.PDA_Manifest.Cut() if(H.mind && (H.mind.assigned_role != H.mind.special_role)) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 5483b5a4c21..9abedd63a0d 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -225,7 +225,7 @@ var/list/variable_html = list() if(islist) var/list/L = D - for(var/i in 1 to L.len) + for(var/i in 1 to length(L)) var/key = L[i] var/value if(IS_NORMAL_LIST(L) && !isnum(key)) @@ -511,8 +511,8 @@ var/list/L = value var/list/items = list() - if(L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > (IS_NORMAL_LIST(L) ? 250 : 300))) - for(var/i in 1 to L.len) + if(length(L) > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || length(L) > (IS_NORMAL_LIST(L) ? 250 : 300))) + for(var/i in 1 to length(L)) var/key = L[i] var/val if(IS_NORMAL_LIST(L) && !isnum(key)) @@ -523,10 +523,10 @@ items += debug_variable(key, val, level + 1, sanitize = sanitize) - item = "[VV_HTML_ENCODE(name)] = /list ([L.len])
    [items.Join()]
" + item = "[VV_HTML_ENCODE(name)] = /list ([length(L)])
    [items.Join()]
" else - item = "[VV_HTML_ENCODE(name)] = /list ([L.len])" + item = "[VV_HTML_ENCODE(name)] = /list ([length(L)])" else item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(value)]" @@ -1049,7 +1049,7 @@ to_chat(usr, "This can only be done to instances of type /mob") return - if(!H.languages.len) + if(!length(H.languages)) to_chat(usr, "This mob knows no languages.") return @@ -1400,9 +1400,9 @@ return TRUE L.len = value["value"] - log_world("### ListVarEdit by [src]: /list len: [L.len]") - log_admin("[key_name(src)] modified list's len: [L.len]") - message_admins("[key_name_admin(src)] modified list's len: [L.len]") + log_world("### ListVarEdit by [src]: /list len: [length(L)]") + log_admin("[key_name(src)] modified list's len: [length(L)]") + message_admins("[key_name_admin(src)] modified list's len: [length(L)]") return TRUE if(href_list["listshuffle"]) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 0675cdf52bf..ccfabbd9a88 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -49,9 +49,9 @@ GLOBAL_LIST_INIT(advance_cures, list( D = null // Generate symptoms if we weren't given any. - if(!symptoms || !symptoms.len) + if(!symptoms || !length(symptoms)) - if(!D || !D.symptoms || !D.symptoms.len) + if(!D || !D.symptoms || !length(D.symptoms)) symptoms = GenerateSymptoms(0, 2) else for(var/datum/symptom/S in D.symptoms) @@ -71,7 +71,7 @@ GLOBAL_LIST_INIT(advance_cures, list( /datum/disease/advance/stage_act() if(!..()) return FALSE - if(symptoms && symptoms.len) + if(symptoms && length(symptoms)) if(!processing) processing = TRUE @@ -162,7 +162,7 @@ GLOBAL_LIST_INIT(advance_cures, list( if(!HasSymptom(S)) possible_symptoms += S - if(!possible_symptoms.len) + if(!length(possible_symptoms)) return generated // Random chance to get more than one symptom @@ -172,7 +172,7 @@ GLOBAL_LIST_INIT(advance_cures, list( while(prob(20)) number_of += 1 - for(var/i = 1; number_of >= i && possible_symptoms.len; i++) + for(var/i = 1; number_of >= i && length(possible_symptoms); i++) generated += pick_n_take(possible_symptoms) return generated @@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(advance_cures, list( //Generate disease properties based on the effects. Returns an associated list. /datum/disease/advance/proc/GenerateProperties() - if(!symptoms || !symptoms.len) + if(!symptoms || !length(symptoms)) CRASH("We did not have any symptoms before generating properties.") var/list/properties = list("resistance" = 1, "stealth" = 0, "stage rate" = 1, "transmittable" = 1, "severity" = 0) @@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(advance_cures, list( // Assign the properties that are in the list. /datum/disease/advance/proc/AssignProperties(list/properties = list()) - if(properties && properties.len) + if(properties && length(properties)) switch(properties["stealth"]) if(2) visibility_flags = HIDDEN_SCANNER @@ -220,7 +220,7 @@ GLOBAL_LIST_INIT(advance_cures, list( visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC // The more symptoms we have, the less transmittable it is but some symptoms can make up for it. - SetSpread(clamp(2 ** (properties["transmittable"] - symptoms.len), BLOOD, AIRBORNE)) + SetSpread(clamp(2 ** (properties["transmittable"] - length(symptoms)), BLOOD, AIRBORNE)) permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1) cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20 stage_prob = max(properties["stage rate"], 2) @@ -266,8 +266,8 @@ GLOBAL_LIST_INIT(advance_cures, list( // Will generate a random cure, the less resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure(list/properties = list()) - if(properties && properties.len) - var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len) + if(properties && length(properties)) + var/res = clamp(properties["resistance"] - (length(symptoms) / 2), 1, length(GLOB.advance_cures)) // to_chat(world, "Res = [res]") cures = list(GLOB.advance_cures[res]) @@ -288,7 +288,7 @@ GLOBAL_LIST_INIT(advance_cures, list( // Randomly remove a symptom. /datum/disease/advance/proc/Devolve() - if(symptoms.len > 1) + if(length(symptoms) > 1) var/s = safepick(symptoms) if(s) RemoveSymptom(s) @@ -319,7 +319,7 @@ GLOBAL_LIST_INIT(advance_cures, list( if(HasSymptom(S)) return - if(symptoms.len < (VIRUS_SYMPTOM_LIMIT - 1) + rand(-1, 1)) + if(length(symptoms) < (VIRUS_SYMPTOM_LIMIT - 1) + rand(-1, 1)) symptoms += S else RemoveSymptom(pick(symptoms)) @@ -347,14 +347,14 @@ GLOBAL_LIST_INIT(advance_cures, list( for(var/datum/disease/advance/A in D_list) diseases += A.Copy() - if(!diseases.len) + if(!length(diseases)) return null - if(diseases.len <= 1) + if(length(diseases) <= 1) return pick(diseases) // Just return the only entry. var/i = 0 // Mix our diseases until we are left with only one result. - while(i < 20 && diseases.len > 1) + while(i < 20 && length(diseases) > 1) i++ @@ -377,7 +377,7 @@ GLOBAL_LIST_INIT(advance_cures, list( for(var/datum/disease/A in data["viruses"]) preserve += A.Copy() R.data = data.Copy() - if(preserve.len) + if(length(preserve)) R.data["viruses"] = preserve /proc/AdminCreateVirus(client/user) @@ -407,7 +407,7 @@ GLOBAL_LIST_INIT(advance_cures, list( i -= 1 while(i > 0) - if(D.symptoms.len > 0) + if(length(D.symptoms) > 0) var/new_name = stripped_input(user, "Name your new disease.", "New Name") if(!new_name) diff --git a/code/datums/diseases/advance/symptoms/damage_converter.dm b/code/datums/diseases/advance/symptoms/damage_converter.dm index 9b5fcf6981f..9d8c47451f8 100644 --- a/code/datums/diseases/advance/symptoms/damage_converter.dm +++ b/code/datums/diseases/advance/symptoms/damage_converter.dm @@ -42,7 +42,7 @@ Bonus var/list/parts = H.get_damaged_organs(TRUE, TRUE, AFFECT_ORGANIC_ORGAN) //1,1 because it needs inputs. - if(!parts.len) + if(!length(parts)) return var/healed = 0 for(var/obj/item/organ/external/E in parts) diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index ddec1008c4c..c6e68cd3f28 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -82,7 +82,7 @@ Bonus // Remove all the diseases we cured. var/mob/living/M = A.affected_mob if(istype(M)) - if(cured_diseases.len) + if(length(cured_diseases)) for(var/res in M.resistances) if(res in cured_diseases) M.resistances -= res diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index 8f72de7f599..454f71fc8bf 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -18,7 +18,7 @@ GLOBAL_LIST_INIT(list_symptoms, subtypesof(/datum/symptom)) /datum/symptom/New() var/list/S = GLOB.list_symptoms - for(var/i = 1; i <= S.len; i++) + for(var/i = 1; i <= length(S); i++) if(type == S[i]) id = "[i]" return diff --git a/code/datums/helper_datums/async_input.dm b/code/datums/helper_datums/async_input.dm index e25fd0ac3e0..35c9b715e41 100644 --- a/code/datums/helper_datums/async_input.dm +++ b/code/datums/helper_datums/async_input.dm @@ -110,11 +110,11 @@ /datum/async_input/ranked/render_choices() var/dat = "
" dat += "" - for(var/i = 1, i <= choices.len, i++) + for(var/i = 1, i <= length(choices), i++) var/choice = choices[i] dat += "" dat += "" - dat += "" + dat += "" dat += "" dat += "" dat += "
[button("+", i != 1 ? "upvote=[i]" : "", null, i == 1)][button("-", i != choices.len ? "downvote=[i]" : "", null, i == choices.len)][button("-", i != length(choices) ? "downvote=[i]" : "", null, i == length(choices))][i]. [choice]
" @@ -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 diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm index 5b534b848b9..9d74a79bae2 100644 --- a/code/datums/helper_datums/construction_datum.dm +++ b/code/datums/helper_datums/construction_datum.dm @@ -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) diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index ec374b634e1..e599974ad1a 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -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 diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index bf93b4039be..e7fc3faef51 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -34,7 +34,7 @@ LAZYADD(H.holo_calls, src) H.atom_say("[area] pad beeps: Incoming call from [caller]!") - if(!dialed_holopads.len) + if(!length(dialed_holopads)) calling_holopad.atom_say("Connection failure.") qdel(src) return @@ -105,7 +105,7 @@ LAZYREMOVE(H.holo_calls, src) dialed_holopads -= H - if(!dialed_holopads.len) + if(!length(dialed_holopads)) if(graceful) calling_holopad.atom_say("Call rejected.") qdel(src) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index f5d05098240..73608ba323e 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -485,12 +485,12 @@ if(istype(robot) && robot.emagged) . += "
Cyborg: Is emagged! Unemag!
0th law: [robot.laws.zeroth_law]" var/mob/living/silicon/ai/ai = current - if(istype(ai) && ai.connected_robots.len) + if(istype(ai) && length(ai.connected_robots)) var/n_e_robots = 0 for(var/mob/living/silicon/robot/R in ai.connected_robots) if(R.emagged) n_e_robots++ - . += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" + . += "
[n_e_robots] of [length(ai.connected_robots)] slaved cyborgs are emagged. Unemag" /datum/mind/proc/memory_edit_uplink() . = "" @@ -685,7 +685,7 @@ if("destroy") var/list/possible_targets = active_ais(1) - if(possible_targets.len) + if(length(possible_targets)) var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets new_objective = new /datum/objective/destroy new_objective.target = new_target.mind @@ -1104,10 +1104,10 @@ if(!(src in SSticker.mode.syndicates)) SSticker.mode.syndicates += src SSticker.mode.update_synd_icons_added(src) - if(SSticker.mode.syndicates.len==1) + if(length(SSticker.mode.syndicates) == 1) SSticker.mode.prepare_syndicate_leader(src) else - current.real_name = "[syndicate_name()] Operative #[SSticker.mode.syndicates.len-1]" + current.real_name = "[syndicate_name()] Operative #[length(SSticker.mode.syndicates) - 1]" special_role = SPECIAL_ROLE_NUKEOPS to_chat(current, "You are a [syndicate_name()] agent!") SSticker.mode.forge_syndicate_objectives(src) @@ -1134,7 +1134,7 @@ if(!SSticker.mode.equip_syndicate(current)) to_chat(usr, "Equipping a syndicate failed!") return - SSticker.mode.update_syndicate_id(current.mind, SSticker.mode.syndicates.len == 1) + SSticker.mode.update_syndicate_id(current.mind, length(SSticker.mode.syndicates) == 1) log_admin("[key_name(usr)] has equipped [key_name(current)] as a nuclear operative") message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a nuclear operative") @@ -1593,10 +1593,10 @@ if(!(src in SSticker.mode.syndicates)) SSticker.mode.syndicates += src SSticker.mode.update_synd_icons_added(src) - if(SSticker.mode.syndicates.len==1) + if(length(SSticker.mode.syndicates) == 1) SSticker.mode.prepare_syndicate_leader(src) else - current.real_name = "[syndicate_name()] Operative #[SSticker.mode.syndicates.len-1]" + current.real_name = "[syndicate_name()] Operative #[length(SSticker.mode.syndicates) - 1]" special_role = SPECIAL_ROLE_NUKEOPS assigned_role = SPECIAL_ROLE_NUKEOPS to_chat(current, "You are a [syndicate_name()] agent!") diff --git a/code/datums/outfits/vv_outfit.dm b/code/datums/outfits/vv_outfit.dm index c211e1001c1..36401cb41fd 100644 --- a/code/datums/outfits/vv_outfit.dm +++ b/code/datums/outfits/vv_outfit.dm @@ -182,7 +182,7 @@ for(var/edit in vedits) if(istext(vedits[edit]) || isnum(vedits[edit]) || isnull(vedits[edit])) stripped_edits[edit] = vedits[edit] - if(stripped_edits.len) + if(length(stripped_edits)) stripped_vv[slot] = stripped_edits .["vv_values"] = stripped_vv diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index 3efc5b1e094..aecbe44d2d2 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -26,7 +26,7 @@ LAZYINITLIST(user.progressbars[bar.loc]) var/list/bars = user.progressbars[bar.loc] bars.Add(src) - listindex = bars.len + listindex = length(bars) animate(bar, pixel_y = 32 + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = 5, easing = SINE_EASING) /datum/progressbar/proc/update(progress) @@ -58,7 +58,7 @@ var/list/bars = user.progressbars[bar.loc] bars.Remove(src) - if(!bars.len) + if(!length(bars)) LAZYREMOVE(user.progressbars, bar.loc) animate(bar, alpha = 0, time = 5) spawn(5) diff --git a/code/datums/radiation_wave.dm b/code/datums/radiation_wave.dm index c7ff5d74af5..19533fd7ebb 100644 --- a/code/datums/radiation_wave.dm +++ b/code/datums/radiation_wave.dm @@ -90,7 +90,7 @@ width-- width = 1 + (2 * width) - for(var/k in 1 to atoms.len) + for(var/k in 1 to length(atoms)) var/atom/thing = atoms[k] if(!thing) continue diff --git a/code/datums/radio_frequency.dm b/code/datums/radio_frequency.dm index 71e891ed3ce..89ffaebf1bc 100644 --- a/code/datums/radio_frequency.dm +++ b/code/datums/radio_frequency.dm @@ -47,9 +47,9 @@ return devices_line += device // var/list/obj/devices_line___ = devices[filter_str] -// var/l = devices_line___.len - //log_admin("DEBUG: devices_line.len=[devices_line.len]") - //log_admin("DEBUG: devices(filter_str).len=[l]") +// var/l = length(devices_line___) + //log_admin("DEBUG: length(devices_line)=[length(devices_line)]") + //log_admin("DEBUG: length(devices(filter_str))=[l]") /datum/radio_frequency/proc/remove_listener(obj/device) for(var/devices_filter in devices) @@ -57,7 +57,7 @@ devices_line-=device while(null in devices_line) devices_line -= null - if(devices_line.len==0) + if(length(devices_line) == 0) devices -= devices_filter qdel(devices_line) diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 3582772446a..8fb79eed615 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -51,7 +51,7 @@ . = -1 else return 0 - if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len) + if((reagents?(length(reagents)):(0)) < length(avail_reagents.reagent_list)) return -1 return . @@ -71,7 +71,7 @@ break if(!found) . = -1 - if(checklist.len) + if(length(checklist)) return 0 return . @@ -103,17 +103,17 @@ for(var/datum/recipe/recipe in available_recipes) if(recipe.check_reagents(obj.reagents) == exact && recipe.check_items(obj, ignored_items) == exact) possible_recipes += recipe - if(possible_recipes.len == 0) + if(length(possible_recipes) == 0) return null - else if(possible_recipes.len == 1) + else if(length(possible_recipes) == 1) return possible_recipes[1] else //okay, let's select the most complicated recipe var/r_count = 0 var/i_count = 0 . = possible_recipes[1] for(var/datum/recipe/recipe in possible_recipes) - var/N_i = (recipe.items)?(recipe.items.len):0 - var/N_r = (recipe.reagents)?(recipe.reagents.len):0 + var/N_i = (recipe.items)?(length(recipe.items)):0 + var/N_r = (recipe.reagents)?(length(recipe.reagents)):0 if(N_i > i_count || (N_i== i_count && N_r > r_count)) r_count = N_r i_count = N_i @@ -128,6 +128,6 @@ /datum/recipe/proc/count_n_items() var/count = 0 - if(items && items.len) - count += items.len + if(items && length(items)) + count += length(items) return count diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm index b7d349b5a32..3cd160c1cc7 100644 --- a/code/datums/spells/area_teleport.dm +++ b/code/datums/spells/area_teleport.dm @@ -49,7 +49,7 @@ if(clear) L+=T - if(!L.len) + if(!length(L)) to_chat(usr, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.") return @@ -62,7 +62,7 @@ var/list/tempL = L var/attempt = null var/success = 0 - while(tempL.len) + while(length(tempL)) attempt = pick(tempL) success = target.Move(attempt) if(!success) diff --git a/code/datums/spells/charge.dm b/code/datums/spells/charge.dm index be5c5a09b88..a35a923267b 100644 --- a/code/datums/spells/charge.dm +++ b/code/datums/spells/charge.dm @@ -20,7 +20,7 @@ if(L.pulling && (isliving(L.pulling))) var/mob/living/M = L.pulling - if(M.mob_spell_list.len != 0 || (M.mind && M.mind.spell_list.len != 0)) + if(length(M.mob_spell_list) != 0 || (M.mind && length(M.mind.spell_list) != 0)) for(var/datum/spell/S in M.mob_spell_list) S.cooldown_handler.revert_cast() if(M.mind) diff --git a/code/datums/spells/conjure.dm b/code/datums/spells/conjure.dm index 74f4a885e4d..048454fbbbf 100644 --- a/code/datums/spells/conjure.dm +++ b/code/datums/spells/conjure.dm @@ -30,7 +30,7 @@ if(delay <= 0 || do_after(user, delay, target = user)) for(var/i=0,iNo target found in range.") return diff --git a/code/datums/spells/mind_transfer.dm b/code/datums/spells/mind_transfer.dm index ffefd1534a1..b980233a9cb 100644 --- a/code/datums/spells/mind_transfer.dm +++ b/code/datums/spells/mind_transfer.dm @@ -50,18 +50,18 @@ Also, you never added distance checking after target is selected. I've went ahea var/mob/living/caster = user//The wizard/whomever doing the body transferring. //MIND TRANSFER BEGIN - if(caster.mind.special_verbs.len)//If the caster had any special verbs, remove them from the mob verb list. + if(length(caster.mind.special_verbs))//If the caster had any special verbs, remove them from the mob verb list. for(var/V in caster.mind.special_verbs)//Since the caster is using an object spell system, this is mostly moot. remove_verb(caster, V) //But a safety nontheless. - if(victim.mind.special_verbs.len)//Now remove all of the victim's verbs. + if(length(victim.mind.special_verbs))//Now remove all of the victim's verbs. for(var/V in victim.mind.special_verbs) remove_verb(victim, V) var/mob/dead/observer/ghost = victim.ghostize(0) caster.mind.transfer_to(victim) - if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster. + if(length(victim.mind.special_verbs))//To add all the special verbs for the original caster. for(var/V in caster.mind.special_verbs)//Not too important but could come into play. add_verb(caster, V) @@ -71,7 +71,7 @@ Also, you never added distance checking after target is selected. I've went ahea caster.key = ghost.key //have to transfer the key since the mind was not active qdel(ghost) - if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here. + if(length(caster.mind.special_verbs))//If they had any special verbs, we add them here. for(var/V in caster.mind.special_verbs) add_verb(caster, V) //MIND TRANSFER END diff --git a/code/datums/spells/turf_teleport.dm b/code/datums/spells/turf_teleport.dm index 936d4c3fda9..ac20dea2ae8 100644 --- a/code/datums/spells/turf_teleport.dm +++ b/code/datums/spells/turf_teleport.dm @@ -35,7 +35,7 @@ continue turfs += T - if(!turfs.len) + if(!length(turfs)) var/list/turfs_to_pick_from = list() for(var/turf/T in orange(target,outer_tele_radius)) if(!(T in orange(target,inner_tele_radius))) diff --git a/code/datums/uplink_items/uplink_general.dm b/code/datums/uplink_items/uplink_general.dm index 7f36a727544..21bea123b93 100644 --- a/code/datums/uplink_items/uplink_general.dm +++ b/code/datums/uplink_items/uplink_general.dm @@ -6,7 +6,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) var/list/uplink_items = list() var/list/sales_items = list() var/newreference = 1 - if(!uplink_items.len) + if(!length(uplink_items)) var/list/last = list() for(var/path in GLOB.uplink_items) diff --git a/code/datums/weather/weather_types/ash_storm.dm b/code/datums/weather/weather_types/ash_storm.dm index 0c1407e8aed..636dbb3dc60 100644 --- a/code/datums/weather/weather_types/ash_storm.dm +++ b/code/datums/weather/weather_types/ash_storm.dm @@ -54,7 +54,7 @@ if(!golemShuttleOnPlanet) eligible_areas -= get_areas(/area/shuttle/freegolem) - for(var/i in 1 to eligible_areas.len) + for(var/i in 1 to length(eligible_areas)) var/area/place = eligible_areas[i] if(place.outdoors) outside_areas += place diff --git a/code/game/alternate_appearance.dm b/code/game/alternate_appearance.dm index 4e6c0b052de..b7cdb4f8d55 100644 --- a/code/game/alternate_appearance.dm +++ b/code/game/alternate_appearance.dm @@ -23,7 +23,7 @@ displayTo - a list of MOBS to show this appearance to */ /datum/alternate_appearance/proc/display_to(list/displayTo) - if(!displayTo || !displayTo.len) + if(!displayTo || !length(displayTo)) return for(var/m in displayTo) var/mob/M = m @@ -47,7 +47,7 @@ var/mob/M = m if(M.client) M.client.images -= img - if(M.viewing_alternate_appearances && M.viewing_alternate_appearances.len) + if(M.viewing_alternate_appearances && length(M.viewing_alternate_appearances)) M.viewing_alternate_appearances -= src viewers -= M @@ -94,7 +94,7 @@ if(alternate_appearances[key]) qdel(alternate_appearances[key]) alternate_appearances[key] = AA - if(displayTo && displayTo.len) + if(displayTo && length(displayTo)) display_alt_appearance(key, displayTo) diff --git a/code/game/area/areas/depot-areas.dm b/code/game/area/areas/depot-areas.dm index 8831d808981..b9e045e1d45 100644 --- a/code/game/area/areas/depot-areas.dm +++ b/code/game/area/areas/depot-areas.dm @@ -133,7 +133,7 @@ /area/syndicate_depot/core/proc/armory_locker_looted() if(!run_finished && !used_self_destruct) - if(shield_list.len) + if(length(shield_list)) activate_self_destruct("Armory compromised despite armory shield being online.", FALSE) return declare_finished() @@ -221,7 +221,7 @@ var/obj/effect/landmark/L = thing if(L.name == "syndi_depot_bot") possible_bot_spawns |= L - if(possible_bot_spawns.len) + if(length(possible_bot_spawns)) var/obj/effect/landmark/S = pick(possible_bot_spawns) new /obj/effect/portal(get_turf(S)) var/mob/living/simple_animal/bot/ed209/syndicate/B = new /mob/living/simple_animal/bot/ed209/syndicate(get_turf(S)) @@ -345,7 +345,7 @@ SEND_SOUND(R, sound('sound/misc/notice1.ogg')) /area/syndicate_depot/core/proc/shields_up() - if(shield_list.len) + if(length(shield_list)) return for(var/thing in GLOB.landmarks_list) var/obj/effect/landmark/L = thing @@ -362,7 +362,7 @@ A.lock() /area/syndicate_depot/core/proc/shields_key_check() - if(!shield_list.len) + if(!length(shield_list)) return if(detected_mech || detected_pod || detected_double_agent) return @@ -485,7 +485,7 @@ var/list/shield_list = list() /area/syndicate_depot/perimeter/proc/perimeter_shields_up() - if(shield_list.len) + if(length(shield_list)) return for(var/turf/T in src) var/obj/machinery/shieldwall/syndicate/S = new /obj/machinery/shieldwall/syndicate(T) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index c76d3d6d7f8..996ba8dd2f6 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -368,7 +368,7 @@ pass |= istype(A, type) if(!pass) continue - if(A.contents.len) + if(length(A.contents)) found += A.search_contents_for(path, filter_path) return found @@ -393,13 +393,13 @@ if(reagents) if(container_type & TRANSPARENT) . += "It contains:" - if(reagents.reagent_list.len) + if(length(reagents.reagent_list)) if(user.can_see_reagents()) //Show each individual reagent for(var/I in reagents.reagent_list) var/datum/reagent/R = I . += "[R.volume] units of [R.name]" else //Otherwise, just show the total volume - if(reagents && reagents.reagent_list.len) + if(reagents && length(reagents.reagent_list)) . += "[reagents.total_volume] units of various reagents." else . += "Nothing." @@ -845,9 +845,9 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) /atom/proc/transfer_blood_dna(list/blood_dna) if(!blood_DNA) blood_DNA = list() - var/old_length = blood_DNA.len + var/old_length = length(blood_DNA) blood_DNA |= blood_dna - if(blood_DNA.len > old_length) + if(length(blood_DNA) > old_length) return TRUE//some new blood DNA was added //to add blood from a mob onto something, and transfer their dna info @@ -1027,7 +1027,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) var/cur_x = null var/cur_y = null var/list/y_arr = null - for(cur_x in 1 to GLOB.global_map.len) + for(cur_x in 1 to length(GLOB.global_map)) y_arr = GLOB.global_map[cur_x] cur_y = y_arr.Find(src.z) if(cur_y) @@ -1155,12 +1155,12 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) Adds an instance of colour_type to the atom's atom_colours list */ /atom/proc/add_atom_colour(coloration, colour_priority) - if(!atom_colours || !atom_colours.len) + if(!atom_colours || !length(atom_colours)) atom_colours = list() atom_colours.len = COLOUR_PRIORITY_AMOUNT //four priority levels currently. if(!coloration) return - if(colour_priority > atom_colours.len) + if(colour_priority > length(atom_colours)) return atom_colours[colour_priority] = coloration update_atom_colour() @@ -1172,7 +1172,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) if(!atom_colours) atom_colours = list() atom_colours.len = COLOUR_PRIORITY_AMOUNT //four priority levels currently. - if(colour_priority > atom_colours.len) + if(colour_priority > length(atom_colours)) return if(coloration && atom_colours[colour_priority] != coloration) return //if we don't have the expected color (for a specific priority) to remove, do nothing @@ -1191,7 +1191,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) for(var/C in atom_colours) if(islist(C)) var/list/L = C - if(L.len) + if(length(L)) color = L return else if(C) diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 090aa51320f..86d0448bbac 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -126,9 +126,9 @@ GLOBAL_LIST_EMPTY(bad_blocks) SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative. - SetUIValueRange(DNA_UI_HEAD_MARK_STYLE, head_marks, GLOB.marking_styles_list.len, 1) - SetUIValueRange(DNA_UI_BODY_MARK_STYLE, body_marks, GLOB.marking_styles_list.len, 1) - SetUIValueRange(DNA_UI_TAIL_MARK_STYLE, tail_marks, GLOB.marking_styles_list.len, 1) + SetUIValueRange(DNA_UI_HEAD_MARK_STYLE, head_marks, length(GLOB.marking_styles_list), 1) + SetUIValueRange(DNA_UI_BODY_MARK_STYLE, body_marks, length(GLOB.marking_styles_list), 1) + SetUIValueRange(DNA_UI_TAIL_MARK_STYLE, tail_marks, length(GLOB.marking_styles_list), 1) SetUIValueRange(DNA_UI_PHYSIQUE, GLOB.character_physiques.Find(character.physique), length(GLOB.character_physiques), 1) SetUIValueRange(DNA_UI_HEIGHT, GLOB.character_heights.Find(character.height), length(GLOB.character_heights), 1) @@ -393,7 +393,7 @@ GLOBAL_LIST_EMPTY(bad_blocks) // Just checks our character has all the crap it needs. /datum/dna/proc/check_integrity(mob/living/carbon/human/character) if(character) - if(UI.len != DNA_UI_LENGTH) + if(length(UI) != DNA_UI_LENGTH) ResetUIFrom(character) if(length(struc_enzymes)!= 3 * DNA_SE_LENGTH) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index e8008e25ba9..b3de3a92f38 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -163,16 +163,16 @@ H.change_gender(PLURAL, FALSE) //Head Markings - var/head_marks = dna.GetUIValueRange(DNA_UI_HEAD_MARK_STYLE, GLOB.marking_styles_list.len) - if((head_marks > 0) && (head_marks <= GLOB.marking_styles_list.len)) + var/head_marks = dna.GetUIValueRange(DNA_UI_HEAD_MARK_STYLE, length(GLOB.marking_styles_list)) + if((head_marks > 0) && (head_marks <= length(GLOB.marking_styles_list))) H.m_styles["head"] = GLOB.marking_styles_list[head_marks] //Body Markings - var/body_marks = dna.GetUIValueRange(DNA_UI_BODY_MARK_STYLE, GLOB.marking_styles_list.len) - if((body_marks > 0) && (body_marks <= GLOB.marking_styles_list.len)) + var/body_marks = dna.GetUIValueRange(DNA_UI_BODY_MARK_STYLE, length(GLOB.marking_styles_list)) + if((body_marks > 0) && (body_marks <= length(GLOB.marking_styles_list))) H.m_styles["body"] = GLOB.marking_styles_list[body_marks] //Tail Markings - var/tail_marks = dna.GetUIValueRange(DNA_UI_TAIL_MARK_STYLE, GLOB.marking_styles_list.len) - if((tail_marks > 0) && (tail_marks <= GLOB.marking_styles_list.len)) + var/tail_marks = dna.GetUIValueRange(DNA_UI_TAIL_MARK_STYLE, length(GLOB.marking_styles_list)) + if((tail_marks > 0) && (tail_marks <= length(GLOB.marking_styles_list))) H.m_styles["tail"] = GLOB.marking_styles_list[tail_marks] // Physique (examine fluff) @@ -207,8 +207,8 @@ /datum/dna/proc/write_head_attributes(obj/item/organ/external/head/head_organ) //Hair - var/hair = GetUIValueRange(DNA_UI_HAIR_STYLE,GLOB.hair_styles_full_list.len) - if((hair > 0) && (hair <= GLOB.hair_styles_full_list.len)) + var/hair = GetUIValueRange(DNA_UI_HAIR_STYLE,length(GLOB.hair_styles_full_list)) + if((hair > 0) && (hair <= length(GLOB.hair_styles_full_list))) head_organ.h_style = GLOB.hair_styles_full_list[hair] head_organ.hair_colour = rgb(head_organ.dna.GetUIValueRange(DNA_UI_HAIR_R, 255), head_organ.dna.GetUIValueRange(DNA_UI_HAIR_G, 255), head_organ.dna.GetUIValueRange(DNA_UI_HAIR_B, 255)) @@ -223,8 +223,8 @@ head_organ.h_grad_colour = rgb(head_organ.dna.GetUIValueRange(DNA_UI_HAIR_GRADIENT_R, 255), head_organ.dna.GetUIValueRange(DNA_UI_HAIR_GRADIENT_G, 255), head_organ.dna.GetUIValueRange(DNA_UI_HAIR_GRADIENT_B, 255)) //Facial Hair - var/beard = GetUIValueRange(DNA_UI_BEARD_STYLE,GLOB.facial_hair_styles_list.len) - if((beard > 0) && (beard <= GLOB.facial_hair_styles_list.len)) + var/beard = GetUIValueRange(DNA_UI_BEARD_STYLE,length(GLOB.facial_hair_styles_list)) + if((beard > 0) && (beard <= length(GLOB.facial_hair_styles_list))) head_organ.f_style = GLOB.facial_hair_styles_list[beard] head_organ.facial_colour = rgb(head_organ.dna.GetUIValueRange(DNA_UI_BEARD_R, 255), head_organ.dna.GetUIValueRange(DNA_UI_BEARD_G, 255), head_organ.dna.GetUIValueRange(DNA_UI_BEARD_B, 255)) @@ -308,8 +308,8 @@ SetUIValueRange(DNA_UI_HAIR_GRADIENT_X, head_organ.h_grad_offset_x + 16, 32, 1) SetUIValueRange(DNA_UI_HAIR_GRADIENT_Y, head_organ.h_grad_offset_y + 16, 32, 1) - SetUIValueRange(DNA_UI_HAIR_STYLE, hair, GLOB.hair_styles_full_list.len, 1) - SetUIValueRange(DNA_UI_BEARD_STYLE, beard, GLOB.facial_hair_styles_list.len, 1) + SetUIValueRange(DNA_UI_HAIR_STYLE, hair, length(GLOB.hair_styles_full_list), 1) + SetUIValueRange(DNA_UI_BEARD_STYLE, beard, length(GLOB.facial_hair_styles_list), 1) SetUIValueRange(DNA_UI_HAIR_GRADIENT_STYLE, gradient, length(GLOB.hair_gradients_list), 1) var/list/available = character.generate_valid_head_accessories() diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index cfb8f17e08a..89b670b0975 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -351,7 +351,7 @@ /obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(list/buffer) var/list/arr = list() - for(var/i = 1, i <= buffer.len, i++) + for(var/i = 1, i <= length(buffer), i++) arr += "[i]:[EncodeDNABlock(buffer[i])]" return arr @@ -468,7 +468,7 @@ data["beakerVolume"] = 0 if(connected.beaker) data["beakerLabel"] = connected.beaker.label_text ? connected.beaker.label_text : null - if(connected.beaker.reagents && connected.beaker.reagents.reagent_list.len) + if(length(connected.beaker.reagents.reagent_list)) for(var/datum/reagent/R in connected.beaker.reagents.reagent_list) data["beakerVolume"] += R.volume diff --git a/code/game/dna/mutations/disabilities.dm b/code/game/dna/mutations/disabilities.dm index f6b570d6f4d..c0140fcb7ca 100644 --- a/code/game/dna/mutations/disabilities.dm +++ b/code/game/dna/mutations/disabilities.dm @@ -435,7 +435,7 @@ var/list/words = splittext(message," ") var/list/rearranged = list() - for(var/i=1;i<=words.len;i++) + for(var/i=1;i<=length(words);i++) var/cword = pick(words) words.Remove(cword) var/suffix = copytext(cword,length(cword)-1,length(cword)) diff --git a/code/game/dna/mutations/mutation_powers.dm b/code/game/dna/mutations/mutation_powers.dm index 58a538d19af..463b3275786 100644 --- a/code/game/dna/mutations/mutation_powers.dm +++ b/code/game/dna/mutations/mutation_powers.dm @@ -391,7 +391,7 @@ /datum/spell/eat/cast(list/targets, mob/user = usr) - if(!targets.len) + if(!length(targets)) to_chat(user, "No target found in range.") return @@ -700,8 +700,8 @@ if(H.mind && H.mind.initial_account) numbers += H.mind.initial_account.account_number numbers += H.mind.initial_account.account_pin - if(numbers.len>0) - to_chat(user, "Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name].") + if(length(numbers)>0) + to_chat(user, "Numbers: You sense the number[length(numbers)>1?"s":""] [english_list(numbers)] [length(numbers)>1?"are":"is"] important to [M.name].") to_chat(user, "Thoughts: [M.name] is currently [thoughts].") if(M.dna?.GetSEState(GLOB.empathblock)) @@ -867,10 +867,10 @@ M.change_skin_tone(new_tone) if(M.dna.species.bodyflags & HAS_ICON_SKIN_TONE) - var/prompt = "Please select skin tone: 1-[M.dna.species.icon_skin_tones.len] (" - for(var/i = 1 to M.dna.species.icon_skin_tones.len) + var/prompt = "Please select skin tone: 1-[length(M.dna.species.icon_skin_tones)] (" + for(var/i = 1 to length(M.dna.species.icon_skin_tones)) prompt += "[i] = [M.dna.species.icon_skin_tones[i]]" - if(i != M.dna.species.icon_skin_tones.len) + if(i != length(M.dna.species.icon_skin_tones)) prompt += ", " prompt += ")" @@ -878,7 +878,7 @@ if(!new_tone) new_tone = 0 else - new_tone = max(min(round(text2num(new_tone)), M.dna.species.icon_skin_tones.len), 1) + new_tone = max(min(round(text2num(new_tone)), length(M.dna.species.icon_skin_tones)), 1) M.change_skin_tone(new_tone) //Skin colour. diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index be7bf110aa3..371a90bdfab 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -32,7 +32,7 @@ traitor_prob = (num_players - (max_traitors - 1) * 10) * 10 // Stop setup if no possible traitors - if(!possible_traitors.len) + if(!length(possible_traitors)) return 0 if(GLOB.configuration.gamemode.traitor_scaling) @@ -56,7 +56,7 @@ traitor.special_role = SPECIAL_ROLE_TRAITOR traitor.restricted_roles = restricted_jobs -// if(!traitors.len) +// if(!length(traitors)) // return 0 return 1 @@ -120,7 +120,7 @@ if(prob(traitor_prob)) message_admins("Making a new Traitor.") - if(!possible_traitors.len) + if(!length(possible_traitors)) message_admins("No potential traitors. Cancelling new traitor.") traitorcheckloop() return diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index ae13b97766d..67eb21a8aae 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -481,7 +481,7 @@ goal_weights += initial(picked.weight) station_goals += new picked - if(station_goals.len) + if(length(station_goals)) send_station_goals_message() /datum/game_mode/proc/send_station_goals_message() diff --git a/code/game/gamemodes/intercept_report.dm b/code/game/gamemodes/intercept_report.dm index 61a3e945824..15aa4bd2ffd 100644 --- a/code/game/gamemodes/intercept_report.dm +++ b/code/game/gamemodes/intercept_report.dm @@ -93,7 +93,7 @@ if(!man.mind) continue if(man.mind.assigned_role == man.mind.special_role) continue dudes += man - if(dudes.len==0) + if(length(dudes)==0) return null return pick(dudes) @@ -119,7 +119,7 @@ if(man.dna.species.name in SSticker.mode.protected_species) return dudes += man - for(var/i = 0, i < max(GLOB.player_list.len/10,2), i++) + for(var/i = 0, i < max(length(GLOB.player_list)/10,2), i++) dudes += pick(GLOB.player_list) return pick(dudes) diff --git a/code/game/gamemodes/miniantags/abduction/abductee_objectives.dm b/code/game/gamemodes/miniantags/abduction/abductee_objectives.dm index e567f5e0d52..2502eb3e08d 100644 --- a/code/game/gamemodes/miniantags/abduction/abductee_objectives.dm +++ b/code/game/gamemodes/miniantags/abduction/abductee_objectives.dm @@ -35,7 +35,7 @@ for(var/datum/job/J in jobs) if(J.current_positions < 1) jobs -= J - if(jobs.len > 0) + if(length(jobs) > 0) var/datum/job/target = pick(jobs) explanation_text += " a [target.title]." else diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index 9dc28ac372b..f5a56423451 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -27,11 +27,11 @@ /datum/game_mode/abduction/pre_setup() possible_abductors = get_players_for_role(ROLE_ABDUCTOR) - if(!possible_abductors.len) + if(!length(possible_abductors)) return 0 abductor_teams = max(1, min(max_teams,round(num_players()/15))) - var/possible_teams = max(1,round(possible_abductors.len / 2)) + var/possible_teams = max(1,round(length(possible_abductors) / 2)) abductor_teams = min(abductor_teams,possible_teams) abductors.len = 2*abductor_teams @@ -56,7 +56,7 @@ //Team Members if(!preset_agent || !preset_scientist) - if(possible_abductors.len <=2) + if(length(possible_abductors) <=2) return 0 var/datum/mind/scientist diff --git a/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm b/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm index 1dce1c415ff..3812df84a3a 100644 --- a/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm +++ b/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm @@ -133,7 +133,7 @@ ..() spawn(5) var/list/demon_candidates = SSghost_spawns.poll_candidates("Do you want to play as a slaughter demon?", ROLE_DEMON, TRUE, 10 SECONDS, source = /mob/living/simple_animal/demon/slaughter/cult) - if(!demon_candidates.len) + if(!length(demon_candidates)) visible_message("[src] disappears in a flash of red light!") qdel(src) return @@ -182,7 +182,7 @@ validtargets += M - if(!validtargets.len) + if(!length(validtargets)) to_chat(usr, "There are no valid targets!") return diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index e56038057e2..0f2e2f4efaa 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -305,7 +305,7 @@ var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as the [mob_name] ([guardian_type]) of [user.real_name]?", ROLE_GUARDIAN, FALSE, 10 SECONDS, source = src, role_cleanname = "[mob_name] ([guardian_type])") var/mob/dead/observer/theghost = null - if(candidates.len) + if(length(candidates)) theghost = pick(candidates) if(has_guardian(user)) to_chat(user, "You already have a [mob_name]!") diff --git a/code/game/gamemodes/miniantags/guardian/types/lightning_guardian.dm b/code/game/gamemodes/miniantags/guardian/types/lightning_guardian.dm index 34e8dd2195b..98a0b706413 100644 --- a/code/game/gamemodes/miniantags/guardian/types/lightning_guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/types/lightning_guardian.dm @@ -35,7 +35,7 @@ var/datum/beam/B = chain if(B.target == target) return //oh this guy already HAS a chain, let's not chain again - if(enemychains.len > 2) + if(length(enemychains) > 2) var/datum/beam/C = pick(enemychains) qdel(C) enemychains -= C @@ -64,7 +64,7 @@ /mob/living/simple_animal/hostile/guardian/beam/proc/cleardeletedchains() if(summonerchain && QDELETED(summonerchain)) summonerchain = null - if(enemychains.len) + if(length(enemychains)) for(var/chain in enemychains) var/datum/cd = chain if(!chain || QDELETED(cd)) @@ -77,14 +77,14 @@ if(!summonerchain) summonerchain = Beam(summoner, "lightning[rand(1,12)]", 'icons/effects/effects.dmi', time=INFINITY, maxdistance=INFINITY, beam_type=/obj/effect/ebeam/chain) . += chainshock(summonerchain) - if(enemychains.len) + if(length(enemychains)) for(var/chain in enemychains) . += chainshock(chain) /mob/living/simple_animal/hostile/guardian/beam/proc/removechains() if(summonerchain) QDEL_NULL(summonerchain) - if(enemychains.len) + if(length(enemychains)) for(var/chain in enemychains) qdel(chain) enemychains = list() diff --git a/code/game/gamemodes/miniantags/morph/morph_event.dm b/code/game/gamemodes/miniantags/morph/morph_event.dm index 070f4a8bb1e..4367557e389 100644 --- a/code/game/gamemodes/miniantags/morph/morph_event.dm +++ b/code/game/gamemodes/miniantags/morph/morph_event.dm @@ -4,7 +4,7 @@ /datum/event/spawn_morph/proc/get_morph() spawn() var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a morph?", ROLE_MORPH, TRUE, source = /mob/living/simple_animal/hostile/morph) - if(!candidates.len) + if(!length(candidates)) key_of_morph = null kill() return diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 790fa4ee447..ef28580d675 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -162,7 +162,7 @@ else var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as a revenant?", poll_time = 15 SECONDS, source = /mob/living/simple_animal/revenant) var/mob/dead/observer/theghost = null - if(candidates.len) + if(length(candidates)) theghost = pick(candidates) message_admins("[key_name_admin(theghost)] has taken control of a revenant created without a mind") key = theghost.key diff --git a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm index 4eb77abb532..227d89666df 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm @@ -14,7 +14,7 @@ spawn() var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a revenant?", ROLE_REVENANT, TRUE, source = /mob/living/simple_animal/revenant) - if(!candidates.len) + if(!length(candidates)) key_of_revenant = null kill() return diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 10161f7d0bf..791be28f86c 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -34,13 +34,13 @@ var/list/possible_syndicates = get_players_for_role(ROLE_OPERATIVE) var/agent_number = 0 - if(possible_syndicates.len < 1) + if(length(possible_syndicates) < 1) return 0 if(LAZYLEN(possible_syndicates) > agents_possible) agent_number = agents_possible else - agent_number = possible_syndicates.len + agent_number = length(possible_syndicates) var/n_players = num_players() if(agent_number > n_players) @@ -115,7 +115,7 @@ break for(var/datum/mind/synd_mind in syndicates) - if(spawnpos > synd_spawn.len) + if(spawnpos > length(synd_spawn)) spawnpos = 2 synd_mind.current.loc = synd_spawn[spawnpos] synd_mind.offstation_role = TRUE @@ -151,8 +151,8 @@ var/player_tc var/remainder - player_tc = round(total_tc / GLOB.nuclear_uplink_list.len) //round to get an integer and not floating point - remainder = total_tc % GLOB.nuclear_uplink_list.len + player_tc = round(total_tc / length(GLOB.nuclear_uplink_list)) //round to get an integer and not floating point + remainder = total_tc % length(GLOB.nuclear_uplink_list) for(var/obj/item/radio/uplink/nuclear/U in GLOB.nuclear_uplink_list) U.hidden_uplink.uses += player_tc diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm index 178399588d9..7acb04f5472 100644 --- a/code/game/gamemodes/nuclear/nuclear_challenge.dm +++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm @@ -68,8 +68,8 @@ var/player_tc var/remainder - player_tc = round(total_tc / GLOB.nuclear_uplink_list.len) //round to get an integer and not floating point - remainder = total_tc % GLOB.nuclear_uplink_list.len + player_tc = round(total_tc / length(GLOB.nuclear_uplink_list)) //round to get an integer and not floating point + remainder = total_tc % length(GLOB.nuclear_uplink_list) for(var/obj/item/radio/uplink/nuclear/U in GLOB.nuclear_uplink_list) U.hidden_uplink.uses += player_tc @@ -84,7 +84,7 @@ if(declaring_war) to_chat(user, "You are already in the process of declaring war! Make your mind up.") return FALSE - if(GLOB.player_list.len < CHALLENGE_MIN_PLAYERS) + if(length(GLOB.player_list) < CHALLENGE_MIN_PLAYERS) to_chat(user, "The enemy crew is too small to be worth declaring war on.") return FALSE if(!is_admin_level(user.z)) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 4860096946f..6ed2761e5c4 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -488,7 +488,7 @@ names[name] = H name_counts[name] = 1 - if(!names.len) + if(!length(names)) user.visible_message("[user]'s pinpointer fails to detect a signal.", "Your pinpointer fails to detect a signal.") return diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 320c2578cdd..222ff61365b 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -121,7 +121,7 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) possible_targets += possible_target - if(possible_targets.len > 0) + if(length(possible_targets) > 0) target = pick(possible_targets) SEND_SIGNAL(src, COMSIG_OBJECTIVE_TARGET_FOUND, target) diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 66cd614b966..f65680cad61 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -1,5 +1,5 @@ /proc/getAssignedBlock(name, list/blocksLeft, activity_bounds=DNA_DEFAULT_BOUNDS, good=0) - if(blocksLeft.len==0) + if(!length(blocksLeft)) warning("[name]: No more blocks left to assign!") return 0 var/assigned = pick(blocksLeft) @@ -129,4 +129,4 @@ warning("DNA2: Mutation [mutation.name] trying to add to already assigned gene block list (used by [english_list(GLOB.assigned_mutation_blocks[block])])") GLOB.assigned_mutation_blocks[block] = mutation - //testing("DNA2: [numsToAssign.len] blocks are unused: [english_list(numsToAssign)]") + //testing("DNA2: [length(numsToAssign)] blocks are unused: [english_list(numsToAssign)]") diff --git a/code/game/gamemodes/vampire/traitor_vamp.dm b/code/game/gamemodes/vampire/traitor_vamp.dm index 96011208404..cdb9fa1036e 100644 --- a/code/game/gamemodes/vampire/traitor_vamp.dm +++ b/code/game/gamemodes/vampire/traitor_vamp.dm @@ -28,7 +28,7 @@ if((player.mind in possible_vampires) && (player.client.prefs.active_character.species in secondary_protected_species)) possible_vampires -= player.mind - if(possible_vampires.len > 0) + if(length(possible_vampires) > 0) for(var/I in possible_vampires) if(length(pre_vampires) >= secondary_enemies) break diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 3074242b50a..a20b8d70f05 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -677,7 +677,7 @@ GLOBAL_LIST_EMPTY(multiverse) check_spooky()//clean out/refresh the list - if(spooky_scaries.len >= 3 && !unlimited) + if(length(spooky_scaries) >= 3 && !unlimited) to_chat(user, "This artifact can only affect three undead at a time!") return if(heresy) @@ -691,7 +691,7 @@ GLOBAL_LIST_EMPTY(multiverse) spooky_scaries |= M to_chat(M, "You have been revived by [user.real_name]!") to_chat(M, "[user.p_theyre(TRUE)] your master now, assist them even if it costs you your new life!") - desc = "A shard capable of resurrecting humans as skeleton thralls[unlimited ? "." : ", [spooky_scaries.len]/3 active thralls."]" + desc = "A shard capable of resurrecting humans as skeleton thralls[unlimited ? "." : ", [length(spooky_scaries)]/3 active thralls."]" /obj/item/necromantic_stone/proc/check_spooky() if(unlimited) //no point, the list isn't used. diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index a524a17e5bf..f312d1f4de0 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -105,7 +105,7 @@ var/mob/dead/observer/harry = null message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.") - if(!candidates.len) + if(!length(candidates)) message_admins("This is awkward, sleeping until another mage check..") making_mage = FALSE sleep(300) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index ccff189cb7c..f53d3f7ba96 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -668,14 +668,14 @@ return FALSE to_chat(user, "[book] crumbles to ashes as you acquire its knowledge.") qdel(book) - else if(items_path.len) + else if(length(items_path)) var/response = tgui_alert(user, "The [src] loadout contains items that will not be refundable if bought. Are you sure this is what you want?", "No refunds!", list("No", "Yes")) if(response != "Yes") return FALSE if(!CanBuy(user, book)) to_chat(user, "You can't afford that anymore!") return FALSE - if(items_path.len) + if(length(items_path)) var/obj/item/storage/box/wizard/B = new(src) for(var/path in items_path) new path(B) @@ -881,7 +881,7 @@ dat += "" var/datum/spellbook_entry/E - for(var/i=1,i<=entries.len,i++) + for(var/i=1,i<=length(entries),i++) var/spell_info = "" E = entries[i] spell_info += E.GetInfo() diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index c0aacd4cf8e..3bdd8468ded 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -67,7 +67,7 @@ /datum/game_mode/wizard/declare_completion(ragin = 0) if(finished && !ragin) SSticker.mode_result = "wizard loss - wizard killed" - to_chat(world, " The wizard[(wizards.len>1)?"s":""] has been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!") + to_chat(world, " The wizard[(length(wizards)>1)?"s":""] has been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!") ..() return TRUE diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 560c136d45e..01d85316fb7 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -56,7 +56,7 @@ for(var/req in req_access) if(!(req in accesses)) //doesn't have this access return 0 - if(req_one_access.len) + if(length(req_one_access)) for(var/req in req_one_access) if(req in accesses) //has an access from the single access list return 1 diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 305d5f1d379..925e8e6f464 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -225,7 +225,7 @@ imprint_pda(H) - if(gear_leftovers.len) + if(length(gear_leftovers)) for(var/datum/gear/G in gear_leftovers) var/atom/placed_in = H.equip_or_collect(G.spawn_item(null, H.client.prefs.active_character.loadout_gear[G.display_name])) if(istype(placed_in)) diff --git a/code/game/jobs/job/silicon_jobs.dm b/code/game/jobs/job/silicon_jobs.dm index a1ab1e683ec..9fdfc71b5f7 100644 --- a/code/game/jobs/job/silicon_jobs.dm +++ b/code/game/jobs/job/silicon_jobs.dm @@ -17,7 +17,7 @@ return FALSE /datum/job/ai/is_position_available() - return (GLOB.empty_playable_ai_cores.len != 0) + return (length(GLOB.empty_playable_ai_cores) != 0) /datum/job/cyborg title = "Cyborg" diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index ae9667593de..d60339f08e6 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -176,7 +176,7 @@ GLOBAL_LIST_INIT(role_playtime_requirements, list( if(!GLOB.configuration.jobs.enable_exp_tracking) return "Tracking is disabled in the server configuration file." var/list/play_records = params2list(prefs.exp) - if(!play_records.len) + if(!length(play_records)) return "[key] has no records." var/return_text = "
    " var/list/exp_data = list() @@ -201,11 +201,11 @@ GLOBAL_LIST_INIT(role_playtime_requirements, list( jobs_unlocked += job.title else jobs_locked += "[job.title] - [job.get_exp_restrictions(mob.client)]" - if(jobs_unlocked.len) + if(length(jobs_unlocked)) return_text += "

    Jobs Unlocked:
    • " return_text += jobs_unlocked.Join("
    • ") return_text += "
    " - if(jobs_locked.len) + if(length(jobs_locked)) return_text += "

    Jobs Not Unlocked:
    • " return_text += jobs_locked.Join("
    • ") return_text += "
    " diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index c34dcfc7b5c..dafa25fc175 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -287,7 +287,7 @@ implantSubData["name"] = sanitize(I.name) implantData.Add(list(implantSubData)) occupantData["implant"] = implantData - occupantData["implant_len"] = implantData.len + occupantData["implant_len"] = length(implantData) var/extOrganData[0] for(var/obj/item/organ/external/E in occupant.bodyparts) @@ -310,7 +310,7 @@ shrapnelData.Add(list(shrapnelSubData)) organData["shrapnel"] = shrapnelData - organData["shrapnel_len"] = shrapnelData.len + organData["shrapnel_len"] = length(shrapnelData) var/organStatus[0] if(E.status & ORGAN_BROKEN) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 46228977536..b5d28534dd9 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -111,7 +111,7 @@ /obj/machinery/autolathe/ui_static_data(mob/user) var/list/data = list() data["categories"] = categories - if(!recipiecache.len) + if(!length(recipiecache)) var/list/recipes = list() for(var/v in files.known_designs) var/datum/design/D = files.known_designs[v] @@ -164,7 +164,7 @@ data["busyamt"] = length(being_built) > 1 ? being_built[2] : 1 data["showhacked"] = hacked ? TRUE : FALSE data["buildQueue"] = queue - data["buildQueueLen"] = queue.len + data["buildQueueLen"] = length(queue) return data /obj/machinery/autolathe/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) @@ -179,7 +179,7 @@ queue = list() if("remove_from_queue") var/index = text2num(params["remove_from_queue"]) - if(isnum(index) && ISINRANGE(index, 1, queue.len)) + if(isnum(index) && ISINRANGE(index, 1, length(queue))) remove_from_queue(index) to_chat(usr, "Removed item from queue.") if("make") @@ -213,7 +213,7 @@ if(!(multiplier in list(1, 10, 25, max_multiplier))) //"enough materials ?" is checked in the build proc message_admins("Player [key_name_admin(usr)] attempted to pass invalid multiplier [multiplier] to an autolathe in ui_act. Possible href exploit.") return - if((queue.len + 1) < queue_max_len) + if((length(queue) + 1) < queue_max_len) add_to_queue(design_last_ordered, multiplier) else to_chat(usr, "The autolathe queue is full!") @@ -247,8 +247,8 @@ var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) var/temp_metal = materials.amount(MAT_METAL) var/temp_glass = materials.amount(MAT_GLASS) - data["processing"] = being_built.len ? get_processing_line() : null - if(istype(queue) && queue.len) + data["processing"] = length(being_built) ? get_processing_line() : null + if(istype(queue) && length(queue)) var/list/data_queue = list() for(var/list/L in queue) var/datum/design/D = L[1] @@ -257,7 +257,7 @@ temp_metal = max(temp_metal - LL[1], 1) temp_glass = max(temp_glass - LL[2], 1) data["queue"] = data_queue - data["queue_len"] = data_queue.len + data["queue_len"] = length(data_queue) else data["queue"] = null return data @@ -417,7 +417,7 @@ desc = initial(desc) /obj/machinery/autolathe/proc/can_build(datum/design/D, multiplier = 1, custom_metal, custom_glass) - if(D.make_reagents.len) + if(length(D.make_reagents)) return 0 var/coeff = get_coeff(D) @@ -456,10 +456,10 @@ queue = list() if(D) queue.Add(list(list(D,multiplier))) - return queue.len + return length(queue) /obj/machinery/autolathe/proc/remove_from_queue(index) - if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len)) + if(!isnum(index) || !istype(queue) || (index<1 || index>length(queue))) return 0 queue.Cut(index,++index) return 1 @@ -469,7 +469,7 @@ var/multiplier = queue[1][2] if(!D) remove_from_queue(1) - if(queue.len) + if(length(queue)) return process_queue() else return diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index eff8932848b..0844f892ac6 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -61,7 +61,7 @@ return ..() /obj/item/camera_assembly/crowbar_act(mob/user, obj/item/I) - if(!upgrades.len) + if(!length(upgrades)) return . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) @@ -87,7 +87,7 @@ return var/list/tempnetwork = splittext(input, ",") - if(tempnetwork.len < 1) + if(length(tempnetwork) < 1) state = ASSEMBLY_WIRED to_chat(usr, "No network found please hang up and try your call again.") return diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 9d7e884319d..49189320e09 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -22,7 +22,7 @@ for(var/obj/machinery/camera/C in L) var/list/tempnetwork = C.network & src.network - if(tempnetwork.len) + if(length(tempnetwork)) T[text("[][]", C.c_tag, (C.can_use() ? null : " (Deactivated)"))] = C track.cameras = T @@ -195,7 +195,7 @@ var/obj/machinery/camera/a var/obj/machinery/camera/b - for(var/i = L.len, i > 0, i--) + for(var/i = length(L), i > 0, i--) for(var/j = 1 to i - 1) a = L[j] b = L[j + 1] diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index f8898a07b65..26e3f776053 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -271,7 +271,7 @@ for(var/obj/structure/AIcore/deactivated/D in world) cores["[D] ([D.loc.loc])"] = D - if(!cores.len) + if(!length(cores)) to_chat(src, "No deactivated AI cores were found.") var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 1c127fe212c..1a9b2a90871 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -22,7 +22,7 @@ /obj/machinery/computer/arcade/proc/prizevend(score) - if(!contents.len) + if(!length(contents)) var/prize_amount if(score) prize_amount = score @@ -354,7 +354,7 @@ /obj/machinery/computer/arcade/orion_trail/attack_hand(mob/user) if(..()) return - if(fuel <= 0 || food <=0 || settlers.len == 0) + if(fuel <= 0 || food <=0 || length(settlers) == 0) gameover = 1 event = null user.set_machine(src) @@ -362,7 +362,7 @@ if(gameover) dat = "

    Game Over

    " dat += "Like many before you, your crew never made it to Orion, lost to space...
    Forever." - if(settlers.len == 0) + if(length(settlers) == 0) dat += "
    Your entire crew died, your ship joins the fleet of ghost-ships littering the galaxy." else if(food <= 0) @@ -757,7 +757,7 @@ if(ORION_TRAIL_LING) eventdat += "Strange reports warn of changelings infiltrating crews on trips to Orion..." - if(settlers.len <= 2) + if(length(settlers) <= 2) eventdat += "
    Your crew's chance of reaching Orion is so slim the changelings likely avoided your ship..." eventdat += "

    Continue

    " eventdat += "

    Close

    " @@ -924,7 +924,6 @@ alive++ return newcrew - //Remove Random/Specific crewmember /obj/machinery/computer/arcade/orion_trail/proc/remove_crewmember(specific = "", dont_remove = "") var/list/safe2remove = settlers @@ -934,7 +933,7 @@ if(specific && specific != dont_remove) safe2remove = list(specific) else - if(safe2remove.len >= 1) //need to make sure we even have anyone to remove + if(length(safe2remove) >= 1) //need to make sure we even have anyone to remove removed = pick(safe2remove) if(removed) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index bd648b91102..8c5a22d2544 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -197,7 +197,7 @@ for(var/obj/machinery/camera/netcam in L) var/list/tempnetwork = netcam.network&origin.networks - if(tempnetwork.len) + if(length(tempnetwork)) T[text("[][]", netcam.c_tag, (netcam.can_use() ? null : " (Deactivated)"))] = netcam diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 046d2445b44..ae5764d4da3 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -161,7 +161,7 @@ stack_trace("Camera in a cameranet has a non-list camera network") continue var/list/tempnetwork = C.network & network - if(tempnetwork.len) + if(length(tempnetwork)) D["[C.c_tag]"] = C return D diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 2727b8c110e..97a55c19cb0 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -189,7 +189,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) return FALSE if(job.job_banned_gamemode) // you cannot open a slot for more sec/legal after revs win return FALSE - if((job.total_positions > GLOB.player_list.len * (max_relative_positions / 100))) + if((job.total_positions > length(GLOB.player_list) * (max_relative_positions / 100))) return FALSE if(opened_positions[job.title] < 0) return TRUE @@ -228,7 +228,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) return FALSE if(job in SSjobs.prioritized_jobs) return TRUE // because this also lets us un-prioritize the job - if(SSjobs.prioritized_jobs.len >= 3) + if(length(SSjobs.prioritized_jobs) >= 3) return FALSE if(job.total_positions <= job.current_positions) return FALSE diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index d374fada3cf..854e307fd60 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -475,7 +475,7 @@ data["str_security_level"] = capitalize(SSsecurity_level.get_current_level_as_text()) var/list/msg_data = list() - for(var/i = 1; i <= messagetext.len; i++) + for(var/i = 1; i <= length(messagetext); i++) msg_data.Add(list(list("title" = messagetitle[i], "body" = messagetext[i], "id" = i))) data["messages"] = msg_data diff --git a/code/game/machinery/computer/message_monitor.dm b/code/game/machinery/computer/message_monitor.dm index c8c08fe993d..5394a21bd30 100644 --- a/code/game/machinery/computer/message_monitor.dm +++ b/code/game/machinery/computer/message_monitor.dm @@ -409,7 +409,7 @@ if(!PM || !PM.can_receive()) continue sendPDAs += P - if(GLOB.PDAs && GLOB.PDAs.len > 0) + if(GLOB.PDAs && length(GLOB.PDAs) > 0) customrecepient = tgui_input_list(usr, "Select a PDA from the list.", items = sortAtom(sendPDAs)) else customrecepient = null diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 96bd846fd7d..28001aa8ba6 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -58,12 +58,12 @@ var/hasContent = 0 desc = "Requires" - for(var/i = 1 to req_components.len) + for(var/i = 1 to length(req_components)) var/tname = req_components[i] var/amt = req_components[tname] if(amt == 0) continue - var/use_and = i == req_components.len + var/use_and = i == length(req_components) desc += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]" hasContent = 1 @@ -133,7 +133,7 @@ state = 2 circuit.loc = src.loc circuit = null - if(components.len == 0) + if(length(components) == 0) to_chat(user, "You remove the circuit board.") else to_chat(user, "You remove the circuit board and other components.") @@ -146,7 +146,7 @@ icon_state = "box_1" return - if(istype(P, /obj/item/storage/part_replacer) && P.contents.len && get_req_components_amt()) + if(istype(P, /obj/item/storage/part_replacer) && length(P.contents) && get_req_components_amt()) var/obj/item/storage/part_replacer/replacer = P var/list/added_components = list() var/list/part_list = list() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 220b290e3a3..f04445faf6f 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -153,7 +153,7 @@ /obj/machinery/computer/cryopod/emag_act(mob/user) user.changeNext_move(CLICK_CD_MELEE) - if(!objective_items.len) + if(!length(objective_items)) visible_message("The console buzzes in an annoyed manner.") playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1) return @@ -390,7 +390,7 @@ // Delete them from datacore. var/announce_rank = null - if(GLOB.PDA_Manifest.len) + if(length(GLOB.PDA_Manifest)) GLOB.PDA_Manifest.Cut() for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["name"] == occupant.real_name) @@ -678,7 +678,7 @@ if((ishuman(person_to_cryo) && istype(get_area(P), /area/station/public/sleep)) || istype(P, /obj/machinery/cryopod/robot)) free_cryopods += P var/obj/machinery/cryopod/target_cryopod = null - if(free_cryopods.len) + if(length(free_cryopods)) target_cryopod = safepick(free_cryopods) if(target_cryopod.check_occupant_allowed(person_to_cryo)) var/turf/T = get_turf(person_to_cryo) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 2f2c4ce3229..e6bd12e67c3 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1546,9 +1546,9 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) if(!electronics) ae = new/obj/item/airlock_electronics(loc) check_access() - if(req_access.len) + if(length(req_access)) ae.selected_accesses = req_access - else if(req_one_access.len) + else if(length(req_one_access)) ae.selected_accesses = req_one_access ae.one_access = 1 ae.unres_access_from = unres_sides diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 3fc3fbebe41..812cd31da9f 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -28,7 +28,7 @@ /obj/machinery/door/window/Initialize(mapload) . = ..() - if(req_access && req_access.len) + if(req_access && length(req_access)) base_state = icon_state if(name != initial(name)) @@ -367,9 +367,9 @@ ae = new/obj/item/airlock_electronics(loc) if(!req_access) check_access() - if(req_access.len) + if(length(req_access)) ae.selected_accesses = req_access - else if(req_one_access.len) + else if(length(req_one_access)) ae.selected_accesses = req_one_access ae.one_access = 1 else diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index bce1e147cae..007bfa82703 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -73,7 +73,7 @@ GLOBAL_LIST_EMPTY(doppler_arrays) to_chat(user, "You rotate [src].") /obj/machinery/doppler_array/proc/print_explosive_logs(mob/user) - if(!logged_explosions.len) + if(!length(logged_explosions)) atom_say("No logs currently stored in internal database.") return if(active_timers) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 78029b71833..ef3c41ec96c 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -399,7 +399,7 @@ GLOBAL_LIST_EMPTY(holopads) /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/machinery/hologram/holopad/hear_talk(atom/movable/speaker, list/message_pieces, verb) - if(speaker && masters.len)//Master is mostly a safety in case lag hits or something. Radio_freq so AIs dont hear holopad stuff through radios. + if(speaker && length(masters))//Master is mostly a safety in case lag hits or something. Radio_freq so AIs dont hear holopad stuff through radios. for(var/mob/living/silicon/ai/master in masters) if(masters[master] && speaker != master) master.relay_speech(speaker, message_pieces, verb) @@ -415,7 +415,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/machinery/hologram/holopad/proc/SetLightsAndPower() - var/total_users = masters.len + LAZYLEN(holo_calls) + var/total_users = length(masters) + LAZYLEN(holo_calls) change_power_mode(total_users > 0 ? ACTIVE_POWER_USE : IDLE_POWER_USE) active_power_consumption = HOLOPAD_PASSIVE_POWER_USAGE + (HOLOGRAM_POWER_USAGE * total_users) if(total_users) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 5898d0c14ac..158e245fccc 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -272,7 +272,7 @@ /obj/machinery/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) on_deconstruction() - if(component_parts && component_parts.len) + if(component_parts && length(component_parts)) spawn_frame(disassembled) for(var/obj/item/I in component_parts) I.forceMove(loc) diff --git a/code/game/machinery/magnetic_module.dm b/code/game/machinery/magnetic_module.dm index 87442eac712..f10aae48db5 100644 --- a/code/game/machinery/magnetic_module.dm +++ b/code/game/machinery/magnetic_module.dm @@ -234,7 +234,7 @@ RegisterSignal(M, COMSIG_PARENT_QDELETING, PROC_REF(on_magnet_del), TRUE) /obj/machinery/magnetic_controller/process() - if(magnets.len == 0 && autolink) + if(length(magnets) == 0 && autolink) link_magnets() /obj/machinery/magnetic_controller/ui_state(mob/user) @@ -416,7 +416,7 @@ /obj/machinery/magnetic_controller/proc/MagnetMove() if(looping) return - while(moving && rpath.len >= 1) + while(moving && length(rpath) >= 1) if(stat & (BROKEN|NOPOWER)) break @@ -430,7 +430,7 @@ signal.frequency = frequency signal.data["code"] = code - if(pathpos > rpath.len) // if the position is greater than the length, we just loop through the list! + if(pathpos > length(rpath)) // if the position is greater than the length, we just loop through the list! pathpos = 1 var/nextmove = uppertext(rpath[pathpos]) // makes it un-case-sensitive diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 13e71b0d39c..46df33dfc23 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -149,7 +149,7 @@ /obj/machinery/poolcontroller/proc/miston() //Spawn /obj/effect/mist (from the shower) on all linked pool tiles - if(linkedmist.len) + if(length(linkedmist)) return for(var/turf/simulated/floor/beach/water/W in linkedturfs) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index acf292c693c..e95ef133f7b 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -75,7 +75,7 @@ /obj/machinery/porta_turret/Initialize(mapload) . = ..() - if(req_access && req_access.len) + if(req_access && length(req_access)) req_access.Cut() req_one_access = list(ACCESS_SECURITY, ACCESS_HEADS) one_access = TRUE @@ -93,7 +93,7 @@ /obj/machinery/porta_turret/centcom/Initialize(mapload) . = ..() - if(req_one_access && req_one_access.len) + if(req_one_access && length(req_one_access)) req_one_access.Cut() req_access = list(ACCESS_CENT_SPECOPS) one_access = FALSE @@ -179,7 +179,7 @@ GLOBAL_LIST_EMPTY(turret_icons) /obj/machinery/porta_turret/proc/HasController() var/area/A = get_area(src) - return A && A.turret_controls.len > 0 + return A && length(A.turret_controls) > 0 /obj/machinery/porta_turret/proc/access_is_configurable() return targetting_is_configurable && !HasController() @@ -635,10 +635,10 @@ GLOBAL_LIST_EMPTY(turret_icons) return TURRET_NOT_TARGET /obj/machinery/porta_turret/proc/tryToShootAt(list/mob/living/targets) - if(targets.len && last_target && (last_target in targets) && target(last_target)) + if(length(targets) && last_target && (last_target in targets) && target(last_target)) return 1 - while(targets.len > 0) + while(length(targets) > 0) var/mob/living/M = pick(targets) targets -= M if(target(M)) @@ -1100,7 +1100,7 @@ GLOBAL_LIST_EMPTY(turret_icons) /obj/machinery/porta_turret/syndicate/Initialize(mapload) . = ..() - if(req_one_access && req_one_access.len) + if(req_one_access && length(req_one_access)) req_one_access.Cut() req_access = list(ACCESS_SYNDICATE) one_access = FALSE diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 7b8b9d83519..ad5ba2bb0d9 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -537,7 +537,7 @@ /obj/item/bombcore/chemical/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/glass/beaker) || istype(I, /obj/item/reagent_containers/glass/bottle)) - if(beakers.len < max_beakers) + if(length(beakers) < max_beakers) if(!user.drop_item()) return beakers += I @@ -553,7 +553,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - if(beakers.len == 0) + if(length(beakers) == 0) return for(var/obj/item/B in beakers) B.loc = get_turf(src) @@ -574,7 +574,7 @@ spread_range += 2 // Extra range, reduced density. temp_boost += 50 // maximum of +150K blast using only large beakers. Not enough to self ignite. for(var/obj/item/slime_extract/S in LG.beakers) // And slime cores. - if(beakers.len < max_beakers) + if(length(beakers) < max_beakers) beakers += S S.loc = src else @@ -591,7 +591,7 @@ time_release += 50 // A typical bomb, using basic beakers, will explode over 2-4 seconds. Using two will make the reaction last for less time, but it will be more dangerous overall. for(var/obj/item/reagent_containers/glass/B in G) - if(beakers.len < max_beakers) + if(length(beakers) < max_beakers) beakers += B B.loc = src else diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index cece7b32c0a..5d82f8830b8 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -245,7 +245,7 @@ var/list/L = list() var/list/areaindex = list() var/list/S = power_station.linked_stations - if(!S.len) + if(!length(S)) return L for(var/obj/machinery/teleport/station/R in S) var/turf/T = get_turf(R) @@ -632,7 +632,7 @@ var/obj/item/multitool/M = I if(!panel_open) if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src) - if(linked_stations.len < efficiency) + if(length(linked_stations) < efficiency) linked_stations.Add(M.buffer) M.buffer = null to_chat(user, "You upload the data from [M]'s buffer.") diff --git a/code/game/mecha/combat/honker.dm b/code/game/mecha/combat/honker.dm index 5ddca924d18..8e25bf3dac6 100644 --- a/code/game/mecha/combat/honker.dm +++ b/code/game/mecha/combat/honker.dm @@ -120,7 +120,7 @@ /obj/mecha/combat/honker/get_equipment_list() - if(!equipment.len) + if(!length(equipment)) return var/output = "Honk-ON-Systems:
    " for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment) diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index f57aa643db7..f53faf14515 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -91,7 +91,7 @@ /obj/mecha/combat/marauder/seraph/loaded/Initialize(mapload) . = ..() //Let it equip whatever is needed. var/obj/item/mecha_parts/mecha_equipment/ME - if(equipment.len)//Now to remove it and equip anew. + if(length(equipment))//Now to remove it and equip anew. for(ME in equipment) equipment -= ME qdel(ME) diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 28dbc2f5bea..4af1b23ae6d 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -99,7 +99,7 @@ /obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/mecha/M) if(istype(M)) - if(M.equipment.len[mode? "Analyze" : "Launch"]\]
    \[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
    Reagents list" + return "[output] \[[mode? "Analyze" : "Launch"]\]
    \[Syringes: [length(syringes)]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
    Reagents list" /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/action(atom/movable/target) if(!action_checks(target)) @@ -289,7 +289,7 @@ return if(mode) return analyze_reagents(target) - if(!syringes.len) + if(!length(syringes)) occupant_message("No syringes loaded.") return if(reagents.total_volume<=0) @@ -356,7 +356,7 @@ processed_reagents.len = 0 var/m = 0 var/message - for(var/i=1 to known_reagents.len) + for(var/i=1 to length(known_reagents)) if(m>=synth_speed) break var/reagent = afilter.get("reagent_[i]") @@ -364,7 +364,7 @@ message = "[m ? ", " : null][known_reagents[reagent]]" processed_reagents += reagent m++ - if(processed_reagents.len) + if(length(processed_reagents)) message += " added to production" START_PROCESSING(SSobj, src) occupant_message(message) @@ -427,7 +427,7 @@ /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_list() var/output - for(var/i=1 to known_reagents.len) + for(var/i=1 to length(known_reagents)) var/reagent_id = known_reagents[i] output += {" [known_reagents[reagent_id]]
    "} return output @@ -442,7 +442,7 @@ return output || "None" /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/load_syringe(obj/item/reagent_containers/syringe/S) - if(syringes.len= 2) occupant_message("The syringe is too far away.") return FALSE @@ -501,12 +501,12 @@ /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/process() if(..()) return - if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain)) + if(!length(processed_reagents) || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain)) occupant_message("Reagent processing stopped.") log_message("Reagent processing stopped.") STOP_PROCESSING(SSobj, src) return - var/amount = synth_speed / processed_reagents.len + var/amount = synth_speed / length(processed_reagents) for(var/reagent in processed_reagents) reagents.add_reagent(reagent,amount) chassis.use_power(energy_drain) @@ -554,6 +554,6 @@ /obj/item/mecha_parts/mecha_equipment/medical/rescue_jaw/can_attach(obj/mecha/M) if(istype(M, /obj/mecha/medical) || istype(M, /obj/mecha/working/ripley/firefighter)) //Odys or firefighters - if(M.equipment.len < M.max_equip) + if(length(M.equipment) < M.max_equip) return TRUE return FALSE diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 575bad890e3..f6a33da3af4 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -94,7 +94,7 @@ if(isobj(target)) var/obj/O = target if(!O.anchored) - if(cargo_holder.cargo.len < cargo_holder.cargo_capacity) + if(length(cargo_holder.cargo) < cargo_holder.cargo_capacity) chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.") O.anchored = TRUE if(do_after_cooldown(target)) @@ -102,7 +102,7 @@ O.forceMove(chassis) O.anchored = FALSE occupant_message("[target] successfully loaded.") - log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]") + log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - length(cargo_holder.cargo)]") else O.anchored = initial(O.anchored) else diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index bae4537ee05..05b6ac9a111 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -495,7 +495,7 @@ /obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/M) if(istype(M, /obj/mecha/working)) - if(M.equipment.len" for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment) @@ -229,11 +229,11 @@ /obj/mecha/proc/log_message(message as text,red=null) log.len++ - log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]") - return log.len + log[length(log)] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]") + return length(log) /obj/mecha/proc/log_append_to_last(message as text,red=null) - var/list/last_entry = log[log.len] + var/list/last_entry = log[length(log)] last_entry["message"] += "
    [red?"":null][message][red?"":null]" return diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm index 72a5f8daacd..c5e87d3789d 100644 --- a/code/game/mecha/mecha_wreckage.dm +++ b/code/game/mecha/mecha_wreckage.dm @@ -21,7 +21,7 @@ . = ..() if(parts) for(var/i in 1 to 2) - if(!parts.len) + if(!length(parts)) break if(prob(60)) continue @@ -53,7 +53,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - if(crowbar_salvage.len) + if(length(crowbar_salvage)) var/obj/S = pick(crowbar_salvage) S.forceMove(user.drop_location()) user.visible_message("[user] pries [S] from [src].", "You pry [S] from [src].") diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 6fd31c92744..6ba689b31dc 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -155,7 +155,7 @@ var/turf/T = get_turf(O) if(T) T.Entered(O) - log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - cargo.len]") + log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - length(cargo)]") return @@ -163,7 +163,7 @@ /obj/mecha/working/ripley/get_stats_part() var/output = ..() output += "Cargo Compartment Contents:
    " - if(cargo.len) + if(length(cargo)) for(var/obj/O in cargo) output += "Unload : [O]
    " else diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index cd63de1feaf..5fe748f2d18 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -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) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 35d339aebcb..e2c8e72e9a1 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -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 diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 562c7390b6c..9f5471fb2ce 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -91,7 +91,7 @@ if(direction & i) dirList += i - if(dirList.len) + if(length(dirList)) var/newDir = pick(dirList) if(newDir == 16) floor = 1 diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index a127b327d13..a2f5b11cbdd 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -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 diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 4f2ece5959f..08703285cc2 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -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) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 0b2958abbce..03a576f0358 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -229,7 +229,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons msg += "No tech origins detected.
    " - if(materials.len) + if(length(materials)) msg += "Extractable materials:
    " for(var/mat in materials) msg += "[CallMaterialName(mat)]
    " //Capitize first word, remove the "$" diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm index 63e2d25fdad..037709e2c00 100644 --- a/code/game/objects/items/ashtray.dm +++ b/code/game/objects/items/ashtray.dm @@ -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("[src] slams into [hit_atom] spilling its contents!") empty_tray() return ..() diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index a7b423a097e..66258630f48 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -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 diff --git a/code/game/objects/items/devices/autopsy.dm b/code/game/objects/items/devices/autopsy.dm index 141a8973895..af9646366c7 100644 --- a/code/game/objects/items/devices/autopsy.dm +++ b/code/game/objects/items/devices/autopsy.dm @@ -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 += "Time of death: Unknown / Still alive

    " - 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 += "Trace Chemicals:
    " for(var/chemID in chemtraces) scan_data += chemID diff --git a/code/game/objects/items/devices/enginepicker.dm b/code/game/objects/items/devices/enginepicker.dm index 46cd5348565..f5fe7521608 100644 --- a/code/game/objects/items/devices/enginepicker.dm +++ b/code/game/objects/items/devices/enginepicker.dm @@ -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 diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index c268ee73404..dbb4ecb723a 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -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 diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 50118af000b..9553c14b5de 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -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] diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index c2d93a5cb98..04d3b60581a 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -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 += "Subject contains the following reagents:" for(var/datum/reagent/R in H.reagents.reagent_list) msgs += "[R.volume]u of [R.name][R.overdosed ? " - OVERDOSING" : ".
    "]" else msgs += "Subject contains no reagents." - if(H.reagents.addiction_list.len) + if(length(H.reagents.addiction_list)) msgs += "Subject is addicted to the following reagents:" for(var/datum/reagent/R in H.reagents.addiction_list) msgs += "[R.name] Stage: [R.addiction_stage]/5" @@ -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") diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 40fbaec9bc8..2e8f73059fd 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -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 = "Transcript:

    " - for(var/i = 1, mytape.storedinfo.len >= i, i++) + for(var/i = 1, length(mytape.storedinfo) >= i, i++) t1 += "[mytape.storedinfo[i]]
    " P.info = t1 P.name = "paper- 'Transcript'" diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index a8817a1b722..62c6af8cb8d 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -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 diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index ca039e8b86c..1439b9134c6 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -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, diff --git a/code/game/objects/items/mixing_bowl.dm b/code/game/objects/items/mixing_bowl.dm index 286e68e3088..59898eec3f1 100644 --- a/code/game/objects/items/mixing_bowl.dm +++ b/code/game/objects/items/mixing_bowl.dm @@ -26,7 +26,7 @@ to_chat(user, "You should clean [src] before you use it for food prep.") 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, "This [src] is full of ingredients, you cannot put more.") return 1 if(istype(I, /obj/item/stack)) @@ -103,7 +103,7 @@ display_name = "Coldsauce" dat += {"[display_name]: [R.volume] unit\s
    "} - if(items_counts.len==0 && reagents.reagent_list.len==0) + if(length(items_counts)==0 && length(reagents.reagent_list)==0) dat = {"[src] is empty
    "} else dat = {"Ingredients:
    [dat]"} diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index f74144a9ca5..8e419170469 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -143,7 +143,7 @@ recipe_list = srl.recipes var/t1 = "Amount Left: [get_amount()]
    " - 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 += "
    " diff --git a/code/game/objects/items/tools/multitool.dm b/code/game/objects/items/tools/multitool.dm index d7eb05149c6..a44742ade66 100644 --- a/code/game/objects/items/tools/multitool.dm +++ b/code/game/objects/items/tools/multitool.dm @@ -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) diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index ef0d3dbe555..efd1ea57792 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -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, "Your [name] loses its flavor.") diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 81bf6cf32a5..445546f20a1 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -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, "[src] can not hold more containers.") 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() diff --git a/code/game/objects/items/weapons/holosign_projector.dm b/code/game/objects/items/weapons/holosign_projector.dm index 4e806509f2e..655286170d4 100644 --- a/code/game/objects/items/weapons/holosign_projector.dm +++ b/code/game/objects/items/weapons/holosign_projector.dm @@ -32,7 +32,7 @@ if(holocreator_busy) to_chat(user, "[src] is busy creating a hologram.") 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, "You clear all active holograms.") @@ -135,7 +135,7 @@ to_chat(user, "You clear all active holograms, and reset your projector to normal.") 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, "You clear all active holograms, and overload your energy projector!") 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, "You clear all active holograms.") - if(signs.len) + if(length(signs)) for(var/H in signs) qdel(H) to_chat(user, "You clear all active holograms.") diff --git a/code/game/objects/items/weapons/melee/energy_melee_weapons.dm b/code/game/objects/items/weapons/melee/energy_melee_weapons.dm index b716a7ce5b1..22acf04add8 100644 --- a/code/game/objects/items/weapons/melee/energy_melee_weapons.dm +++ b/code/game/objects/items/weapons/melee/energy_melee_weapons.dm @@ -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) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index d7904f08627..600550157ce 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -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 diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 447580b14ad..e33ecd54bd1 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -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, "You can't modify [src] with items still inside!") 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, "You cut eyeholes into [src].") new /obj/item/clothing/head/papersack(user.loc) diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 24fcd542715..58c9fc1f0b6 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -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" /* diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index 118b05361e7..74f094d40ae 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -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, "You are already applying meds.") 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, "There is nothing in [src]!") return C.visible_message("[C] [rapid_intake_message]") diff --git a/code/game/objects/items/weapons/storage/storage_base.dm b/code/game/objects/items/weapons/storage/storage_base.dm index 80f1531cee3..cfb1b6015dc 100644 --- a/code/game/objects/items/weapons/storage/storage_base.dm +++ b/code/game/objects/items/weapons/storage/storage_base.dm @@ -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) diff --git a/code/game/objects/items/weapons/storage/surgical_tray.dm b/code/game/objects/items/weapons/storage/surgical_tray.dm index d46f15b0894..c7c91677d8d 100644 --- a/code/game/objects/items/weapons/storage/surgical_tray.dm +++ b/code/game/objects/items/weapons/storage/surgical_tray.dm @@ -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" diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 12d8c9f4c06..403cbe1462b 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -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())) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 2153082219c..91106241eaf 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -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 diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 4a11d6cc15d..5bee6f32e4a 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -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"] diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 054ea1bf822..b349b39b73e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -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("[user] unbuckles all creatures from [src].") else diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 284b39dd50f..9cfbaa16307 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -31,7 +31,7 @@ return if(cistern && !open) - if(!contents.len) + if(!length(contents)) to_chat(user, "The cistern is empty.") return else diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index b5b9a7d8acc..b8182433df2 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -44,7 +44,7 @@ var/list/river_nodes = list() var/num_spawned = 0 var/list/possible_locs = block(locate(min_x, min_y, target_z), locate(max_x, max_y, target_z)) - while(num_spawned < nodes && possible_locs.len) + while(num_spawned < nodes && length(possible_locs)) var/turf/T = pick(possible_locs) var/area/A = get_area(T) if(!istype(A, whitelist_area_type) || (T.flags & NO_LAVA_GEN)) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 8dab455021b..d4c41a5fd55 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -116,9 +116,9 @@ . += dent_decals return - var/overlay = round(damage / damage_cap * damage_overlays.len) + 1 - if(overlay > damage_overlays.len) - overlay = damage_overlays.len + var/overlay = round(damage / damage_cap * length(damage_overlays)) + 1 + if(overlay > length(damage_overlays)) + overlay = length(damage_overlays) if(length(dent_decals)) . += dent_decals @@ -127,9 +127,9 @@ . += dent_decals /turf/simulated/wall/proc/generate_overlays() - var/alpha_inc = 256 / damage_overlays.len + var/alpha_inc = 256 / length(damage_overlays) - for(var/i = 1; i <= damage_overlays.len; i++) + for(var/i = 1; i <= length(damage_overlays); i++) var/image/img = image(icon = 'icons/turf/walls.dmi', icon_state = "overlay_damage") img.blend_mode = BLEND_MULTIPLY img.alpha = (i * alpha_inc) - 1 diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm index 517e5dad0c5..c5a0cad1ea5 100644 --- a/code/game/turfs/simulated/walls_mineral.dm +++ b/code/game/turfs/simulated/walls_mineral.dm @@ -243,7 +243,7 @@ /turf/simulated/wall/mineral/titanium/interior/copyTurf(turf/T) if(T.type != type) T.ChangeTurf(type) - if(underlays.len) + if(length(underlays)) T.underlays = underlays if(T.icon_state != icon_state) T.icon_state = icon_state @@ -343,7 +343,7 @@ /turf/simulated/wall/mineral/plastitanium/interior/copyTurf(turf/T) if(T.type != type) T.ChangeTurf(type) - if(underlays.len) + if(length(underlays)) T.underlays = underlays if(T.icon_state != icon_state) T.icon_state = icon_state diff --git a/code/game/turfs/space/space_turf.dm b/code/game/turfs/space/space_turf.dm index 2cef6597e29..f5815136862 100644 --- a/code/game/turfs/space/space_turf.dm +++ b/code/game/turfs/space/space_turf.dm @@ -147,7 +147,7 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - next_x = (--cur_x||GLOB.global_map.len) + next_x = (--cur_x||length(GLOB.global_map)) y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] /* @@ -172,7 +172,7 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - next_x = (++cur_x > GLOB.global_map.len ? 1 : cur_x) + next_x = (++cur_x > length(GLOB.global_map) ? 1 : cur_x) y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] /* @@ -197,7 +197,7 @@ cur_x = cur_pos["x"] cur_y = cur_pos["y"] y_arr = GLOB.global_map[cur_x] - next_y = (--cur_y||y_arr.len) + next_y = (--cur_y||length(y_arr)) target_z = y_arr[next_y] /* //debug @@ -222,7 +222,7 @@ cur_x = cur_pos["x"] cur_y = cur_pos["y"] y_arr = GLOB.global_map[cur_x] - next_y = (++cur_y > y_arr.len ? 1 : cur_y) + next_y = (++cur_y > length(y_arr) ? 1 : cur_y) target_z = y_arr[next_y] /* //debug diff --git a/code/game/verbs/randomtip.dm b/code/game/verbs/randomtip.dm index 25cc996c8fe..90a0447183d 100644 --- a/code/game/verbs/randomtip.dm +++ b/code/game/verbs/randomtip.dm @@ -7,9 +7,9 @@ var/list/randomtips = file2list("strings/tips.txt") var/list/memetips = file2list("strings/sillytips.txt") - if(randomtips.len && prob(95)) + if(length(randomtips) && prob(95)) m = pick(randomtips) - else if(memetips.len) + else if(length(memetips)) m = pick(memetips) if(m) diff --git a/code/game/world.dm b/code/game/world.dm index 37226335dd3..e934067c084 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -185,7 +185,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) /world/proc/load_mode() var/list/Lines = file2list("data/mode.txt") - if(Lines.len) + if(length(Lines)) if(Lines[1]) GLOB.master_mode = Lines[1] log_game("Saved mode is '[GLOB.master_mode]'") diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index 846d4fc0f0e..1f88ee3f7bf 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -152,7 +152,7 @@ memolist += "[ckey]" qdel(query_memodellist) - if(!memolist.len) + if(!length(memolist)) to_chat(src, "No memos found in database.") return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c07c71a4a2a..49d8b4f0817 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -871,7 +871,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list( for(var/datum/job/J in SSjobs.occupations) if(J.current_positions >= J.total_positions && J.total_positions != -1) jobs += J.title - if(!jobs.len) + if(!length(jobs)) to_chat(usr, "There are no fully staffed jobs.") return var/job = input("Please select job slot to free", "Free Job Slot") as null|anything in jobs diff --git a/code/modules/admin/misc_admin_procs.dm b/code/modules/admin/misc_admin_procs.dm index 86370f2220b..40729ea7e0f 100644 --- a/code/modules/admin/misc_admin_procs.dm +++ b/code/modules/admin/misc_admin_procs.dm @@ -111,9 +111,9 @@ GLOBAL_VAR_INIT(nologevent, 0) body += "SEND ALERT\]
    " body += "Mob type: [M.type]
    " if(M.client) - if(M.client.related_accounts_cid.len) + if(length(M.client.related_accounts_cid)) body += "Related accounts by CID: [jointext(M.client.related_accounts_cid, " - ")]
    " - if(M.client.related_accounts_ip.len) + if(length(M.client.related_accounts_ip)) body += "Related accounts by IP: [jointext(M.client.related_accounts_ip, " - ")]

    " if(M.ckey) @@ -726,11 +726,11 @@ GLOBAL_VAR_INIT(nologevent, 0) if(copytext("[path]", -needle_length) == object) matches += path - if(matches.len==0) + if(length(matches)==0) return var/chosen - if(matches.len==1) + if(length(matches)==1) chosen = matches[1] else chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index bcf88a9d935..ca98106ea1b 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -366,7 +366,7 @@ dat += "[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]
    " dat += "
    Antagonist Teams
    " dat += "View Teams
    " - if(SSticker.mode.syndicates.len) + if(length(SSticker.mode.syndicates)) dat += "
    " for(var/datum/mind/N in SSticker.mode.syndicates) var/mob/M = N.current @@ -413,65 +413,65 @@ dat += "
    Syndicates
    " - if(SSticker.mode.blob_overminds.len) + if(length(SSticker.mode.blob_overminds)) dat += check_role_table("Blob Overminds", SSticker.mode.blob_overminds) dat += "Blob Tiles: [length(GLOB.blobs)]" - if(SSticker.mode.changelings.len) + if(length(SSticker.mode.changelings)) dat += check_role_table("Changelings", SSticker.mode.changelings) - if(SSticker.mode.wizards.len) + if(length(SSticker.mode.wizards)) dat += check_role_table("Wizards", SSticker.mode.wizards) - if(SSticker.mode.apprentices.len) + if(length(SSticker.mode.apprentices)) dat += check_role_table("Apprentices", SSticker.mode.apprentices) - /*if(ticker.mode.ninjas.len) + /*if(length(ticker.mode.ninjas)) dat += check_role_table("Ninjas", ticker.mode.ninjas)*/ if(SSticker.mode.cult_team) dat += check_role_table("Cultists", SSticker.mode.cult_team.members) dat += "View Cult Team & Controls
    " - if(SSticker.mode.traitors.len) + if(length(SSticker.mode.traitors)) dat += check_role_table("Traitors", SSticker.mode.traitors) - if(SSticker.mode.implanted.len) + if(length(SSticker.mode.implanted)) dat += check_role_table("Mindslaves", SSticker.mode.implanted) - if(SSticker.mode.abductors.len) + if(length(SSticker.mode.abductors)) dat += check_role_table("Abductors", SSticker.mode.abductors) - if(SSticker.mode.abductees.len) + if(length(SSticker.mode.abductees)) dat += check_role_table("Abductees", SSticker.mode.abductees) - if(SSticker.mode.vampires.len) + if(length(SSticker.mode.vampires)) dat += check_role_table("Vampires", SSticker.mode.vampires) - if(SSticker.mode.vampire_enthralled.len) + if(length(SSticker.mode.vampire_enthralled)) dat += check_role_table("Vampire Thralls", SSticker.mode.vampire_enthralled) - if(SSticker.mode.xenos.len) + if(length(SSticker.mode.xenos)) dat += check_role_table("Xenos", SSticker.mode.xenos) - if(SSticker.mode.superheroes.len) + if(length(SSticker.mode.superheroes)) dat += check_role_table("Superheroes", SSticker.mode.superheroes) - if(SSticker.mode.supervillains.len) + if(length(SSticker.mode.supervillains)) dat += check_role_table("Supervillains", SSticker.mode.supervillains) - if(SSticker.mode.greyshirts.len) + if(length(SSticker.mode.greyshirts)) dat += check_role_table("Greyshirts", SSticker.mode.greyshirts) - if(SSticker.mode.eventmiscs.len) + if(length(SSticker.mode.eventmiscs)) dat += check_role_table("Event Roles", SSticker.mode.eventmiscs) - if(GLOB.ts_spiderlist.len) + if(length(GLOB.ts_spiderlist)) var/list/spider_minds = list() for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist) if(S.ckey) spider_minds += S.mind - if(spider_minds.len) + if(length(spider_minds)) dat += check_role_table("Terror Spiders", spider_minds) var/count_eggs = 0 @@ -486,7 +486,7 @@ count_infected = length(GLOB.ts_infected_list) dat += "
    Growing TS on-station: [count_eggs] egg\s, [count_spiderlings] spiderling\s, [count_infected] infected
    " - if(SSticker.mode.ert.len) + if(length(SSticker.mode.ert)) dat += check_role_table("ERT", SSticker.mode.ert) //list active security force count, so admins know how bad things are diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 26ea1891470..2f89291bc38 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -269,7 +269,7 @@ else if(task == "rank") var/new_rank - if(GLOB.admin_ranks.len) + if(length(GLOB.admin_ranks)) new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (GLOB.admin_ranks|"*New Rank*") else new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Mentor", "Trial Admin", "Game Admin", "*New Rank*") @@ -287,7 +287,7 @@ to_chat(usr, "Error: Topic 'editrights': Invalid rank") return if(!GLOB.configuration.admin.use_database_admins) - if(GLOB.admin_ranks.len) + if(length(GLOB.admin_ranks)) if(new_rank in GLOB.admin_ranks) rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights else @@ -757,7 +757,7 @@ notbannedlist += job //Banning comes first - if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. + if(length(notbannedlist)) //at least 1 unbanned job exists in joblist so we have stuff to ban. switch(alert("Temporary Ban of [M.ckey]?", null,"Yes","No", "Cancel")) if("Yes") var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null @@ -1991,7 +1991,7 @@ return var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Play as the special event pet [H]?", poll_time = 20 SECONDS, min_hours = 10, source = petchoice) var/mob/dead/observer/theghost = null - if(candidates.len) + if(length(candidates)) var/mob/living/simple_animal/pet/P = new petchoice(H.loc) theghost = pick(candidates) P.key = theghost.key @@ -2148,7 +2148,7 @@ if(player.current) if(ismindshielded(player.current)) possible_traitors -= player - if(possible_traitors.len) + if(length(possible_traitors)) var/datum/mind/newtraitormind = pick(possible_traitors) var/datum/objective/assassinate/kill_objective = new() @@ -2678,9 +2678,9 @@ var/list/offset = splittext(href_list["offset"],",") var/number = dd_range(1, 100, text2num(href_list["object_count"])) - var/X = offset.len > 0 ? text2num(offset[1]) : 0 - var/Y = offset.len > 1 ? text2num(offset[2]) : 0 - var/Z = offset.len > 2 ? text2num(offset[3]) : 0 + var/X = length(offset) > 0 ? text2num(offset[1]) : 0 + var/Y = length(offset) > 1 ? text2num(offset[2]) : 0 + var/Z = length(offset) > 2 ? text2num(offset[3]) : 0 var/tmp_dir = href_list["object_dir"] var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2 if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10))) @@ -3276,7 +3276,7 @@ var/dat = "Admin Log
    " for(var/l in GLOB.admin_log) dat += "
  • [l]
  • " - if(!GLOB.admin_log.len) + if(!length(GLOB.admin_log)) dat += "No-one has done anything this round!" usr << browse(dat, "window=admin_log") if("maint_ACCESS_BRIG") @@ -3520,7 +3520,7 @@ message_admins("[key_name_admin(mob)] is sending a ([dresscode]) to [killthem ? "assassinate" : "protect"] [key_name_admin(H)]...") var/image/source = image('icons/obj/cardboard_cutout.dmi', "cutout_traitor") var/list/candidates = SSghost_spawns.poll_candidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, TRUE, source = source, role_cleanname = "[killthem ? "murderous" : "protective"] [dresscode]") - if(!candidates.len) + if(!length(candidates)) to_chat(usr, "ERROR: Could not create eventmob. No valid candidates.") return var/mob/C = pick(candidates) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 204385167c7..cddac52cea9 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -32,12 +32,12 @@ var/list/query_list = SDQL2_tokenize(query_text) - if(!query_list || query_list.len < 1) + if(!query_list || length(query_list) < 1) return var/list/querys = SDQL_parse(query_list) - if(!querys || querys.len < 1) + if(!querys || length(querys) < 1) return var/query_log = "executed SDQL query: \"[query_text]\"." @@ -129,7 +129,7 @@ var/datum/temp = d var/i = 0 for(var/v in sets) - if(++i == sets.len) + if(++i == length(sets)) if(isturf(temp) && (v == "x" || v == "y" || v == "z")) continue if(!temp.vv_edit_var(v, SDQL_expression(d, set_list[sets]))) @@ -156,7 +156,7 @@ for(var/val in query_list) if(val == ";") do_parse = 1 - else if(pos >= query_list.len) + else if(pos >= length(query_list)) query_tree += val do_parse = 1 @@ -164,7 +164,7 @@ parser.query = query_tree var/list/parsed_tree parsed_tree = parser.parse() - if(parsed_tree.len > 0) + if(length(parsed_tree) > 0) querys.len = querys_pos querys[querys_pos] = parsed_tree querys_pos++ @@ -282,7 +282,7 @@ var/result = 0 var/val - for(var/i = start, i <= expression.len, i++) + for(var/i = start, i <= length(expression), i++) var/op = "" if(i > start) @@ -337,7 +337,7 @@ var/i = start var/val = null - if(i > expression.len) + if(i > length(expression)) return list("val" = null, "i" = i) if(istype(expression[i], /list)) @@ -375,14 +375,14 @@ else val = SDQL_var(object, expression, i, object) - i = expression.len + i = length(expression) return list("val" = val, "i" = i) /proc/SDQL_var(datum/object, list/expression, start = 1, source) var/v - var/long = start < expression.len + var/long = start < length(expression) if(object == world && long && expression[start + 1] == ".") to_chat(usr, "Sorry, but global variables are not supported at the moment.") @@ -431,7 +431,7 @@ else if(expression[start + 1] == "\[" && islist(v)) var/list/L = v var/index = SDQL_expression(source, expression[start + 2]) - if(isnum(index) && (!ISINTEGER(index) || L.len < index)) + if(isnum(index) && (!ISINTEGER(index) || length(L) < index)) to_chat(world, "Invalid list index: [index]") return null return L[index] diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm index 98334649315..e9378b62932 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm @@ -61,7 +61,7 @@ /datum/SDQL_parser/proc/parse_error(error_message) error = 1 to_chat(usr, "SDQL2 Parsing Error: [error_message]") - return query.len + 1 + return length(query) + 1 /datum/SDQL_parser/proc/parse() tree = list() @@ -73,14 +73,14 @@ return tree /datum/SDQL_parser/proc/token(i) - if(i <= query.len) + if(i <= length(query)) return query[i] else return null /datum/SDQL_parser/proc/tokens(i, num) - if(i + num <= query.len) + if(i + num <= length(query)) return query.Copy(i, i + num) else diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 96661c16e5d..df327f41329 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -47,12 +47,12 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Power") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! for(var/datum/regional_powernet/PN in SSmachines.powernets) - if(!PN.nodes || !PN.nodes.len) - if(PN.cables && (PN.cables.len > 1)) + if(!PN.nodes || !length(PN.nodes)) + if(PN.cables && (length(PN.cables) > 1)) var/obj/structure/cable/C = PN.cables[1] to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]") - if(!PN.cables || (PN.cables.len < 10)) - if(PN.cables && (PN.cables.len > 1)) + if(!PN.cables || (length(PN.cables) < 10)) + if(PN.cables && (length(PN.cables) > 1)) var/obj/structure/cable/C = PN.cables[1] to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 85cdf1ffc3e..3dcda8f6401 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -64,13 +64,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!target) to_chat(usr, "Error: callproc(): owner of proc no longer exists.") return - message_admins("[key_name_admin(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") - log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") + message_admins("[key_name_admin(src)] called [target]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"].") + log_admin("[key_name(src)] called [target]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"].") returnval = WrapAdminProcCall(target, procname, lst) // Pass the lst as an argument list to the proc else //this currently has no hascall protection. wasn't able to get it working. - message_admins("[key_name_admin(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]") - log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]") + message_admins("[key_name_admin(src)] called [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]") + log_admin("[key_name(src)] called [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]") returnval = WrapAdminProcCall(GLOBAL_PROC, procname, lst) // Pass the lst as an argument list to the proc to_chat(usr, "[procname] returned: [!isnull(returnval) ? returnval : "null"]") @@ -173,8 +173,8 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) if(!A || !IsValidSrc(A)) to_chat(src, "Error: callproc_datum(): owner of proc no longer exists.") return - message_admins("[key_name_admin(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]") - log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]") + message_admins("[key_name_admin(src)] called [A]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]") + log_admin("[key_name(src)] called [A]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]") spawn() var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index af538663c44..3d672ab6ef3 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -92,7 +92,7 @@ if(!f) output += "  [filters[filter]]: ERROR
    " continue - output += "  [filters[filter]]: [f.len]
    " + output += "  [filters[filter]]: [length(f)]
    " for(var/device in f) if(isobj(device)) output += "    [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])
    " diff --git a/code/modules/admin/verbs/gimmick_team.dm b/code/modules/admin/verbs/gimmick_team.dm index 7210606ba31..783eb958b02 100644 --- a/code/modules/admin/verbs/gimmick_team.dm +++ b/code/modules/admin/verbs/gimmick_team.dm @@ -47,7 +47,7 @@ if(!G.client.is_afk()) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) possible_ghosts += G - for(var/i=teamsize,(i>0&&possible_ghosts.len),i--) //Decrease with every member selected. + for(var/i=teamsize,(i>0&&length(possible_ghosts)),i--) //Decrease with every member selected. var/candidate = input("Pick characters to spawn. This will go on until there either no more ghosts to pick from, or the slots are full.", "Active Players") as null|anything in possible_ghosts // auto-picks if only one candidate possible_ghosts -= candidate players_to_spawn += candidate @@ -55,7 +55,7 @@ to_chat(src, "Polling candidates...") players_to_spawn = SSghost_spawns.poll_candidates("Do you want to play as \a [initial(O.name)]?") - if(!players_to_spawn.len) + if(!length(players_to_spawn)) to_chat(src, "Nobody volunteered.") return 0 diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index a8c21cda320..e0d12efd6d2 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -49,7 +49,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) if(!G.client.is_afk()) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) possible_ghosts += G - for(var/i=teamsize,(i>0&&possible_ghosts.len),i--) //Decrease with every SIT member selected. + for(var/i=teamsize,(i>0&&length(possible_ghosts)),i--) //Decrease with every SIT member selected. var/candidate = input("Pick characters to spawn as a SIT member. This will go on until there either no more ghosts to pick from, or the slots are full.", "Active Players") as null|anything in possible_ghosts // auto-picks if only one candidate possible_ghosts -= candidate infiltrators += candidate @@ -58,7 +58,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) var/image/I = new('icons/obj/cardboard_cutout.dmi', "cutout_sit") infiltrators = SSghost_spawns.poll_candidates("Do you want to play as a Syndicate infiltrator?", ROLE_TRAITOR, TRUE, source = I, role_cleanname = "Syndicate infiltrator") - if(!infiltrators.len) + if(!length(infiltrators)) to_chat(src, "Nobody volunteered.") return 0 @@ -76,10 +76,10 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) var/num_spawned = 1 var/team_leader = null for(var/obj/effect/landmark/L in sit_spawns) - if(!infiltrators.len && !spawn_dummies) break + if(!length(infiltrators) && !spawn_dummies) break syndicate_leader_selected = num_spawned == 1?1:0 var/mob/living/carbon/human/new_syndicate_infiltrator = create_syndicate_infiltrator(L, syndicate_leader_selected, tcamount, 0) - if(infiltrators.len) + if(length(infiltrators)) var/mob/theguy = pick(infiltrators) if(theguy.key != key) new_syndicate_infiltrator.key = theguy.key diff --git a/code/modules/admin/verbs/logging_view.dm b/code/modules/admin/verbs/logging_view.dm index 636378df1ab..89bfc79ad43 100644 --- a/code/modules/admin/verbs/logging_view.dm +++ b/code/modules/admin/verbs/logging_view.dm @@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(open_logging_views) else if(clear_view) cur_view.clear_all() - if(mobs_to_add?.len) + if(length(mobs_to_add)) cur_view.add_mobs(mobs_to_add) cur_view.show_ui(usr) diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index 38cf541e001..f953d1b3c1e 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -111,7 +111,7 @@ if(VV_RESTORE_DEFAULT) to_chat(src, "Finding items...") var/list/items = get_all_of_type(O.type, method) - to_chat(src, "Changing [items.len] items...") + to_chat(src, "Changing [length(items)] items...") for(var/thing in items) if(!thing) continue @@ -126,7 +126,7 @@ var/list/varsvars = vv_parse_text(O, new_value) var/pre_processing = new_value var/unique - if(varsvars && varsvars.len) + if(varsvars && length(varsvars)) unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same") if(unique == "Unique") unique = TRUE @@ -137,7 +137,7 @@ to_chat(src, "Finding items...") var/list/items = get_all_of_type(O.type, method) - to_chat(src, "Changing [items.len] items...") + to_chat(src, "Changing [length(items)] items...") for(var/thing in items) if(!thing) continue @@ -165,7 +165,7 @@ var/type = value["type"] to_chat(src, "Finding items...") var/list/items = get_all_of_type(O.type, method) - to_chat(src, "Changing [items.len] items...") + to_chat(src, "Changing [length(items)] items...") for(var/thing in items) if(!thing) continue @@ -183,7 +183,7 @@ else to_chat(src, "Finding items...") var/list/items = get_all_of_type(O.type, method) - to_chat(src, "Changing [items.len] items...") + to_chat(src, "Changing [length(items)] items...") for(var/thing in items) if(!thing) continue diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 51b5cdae310..0597f2dbf86 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -282,9 +282,9 @@ GLOBAL_PROTECT(VVmaint_only) if(!ispath(type)) return var/list/subtypes = subtypesof(type) - if(!subtypes || !subtypes.len) + if(!subtypes || !length(subtypes)) return FALSE - if(subtypes && subtypes.len) + if(subtypes && length(subtypes)) switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel")) if("Strictly this type") return FALSE @@ -374,7 +374,7 @@ GLOBAL_PROTECT(VVmaint_only) to_chat(src, "Not a List.") return - if(L.len > 1000) + if(length(L) > 1000) var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort") if(confirm != "Continue") return @@ -382,7 +382,7 @@ GLOBAL_PROTECT(VVmaint_only) var/list/names = list() - for(var/i in 1 to L.len) + for(var/i in 1 to length(L)) var/key = L[i] var/value if(IS_NORMAL_LIST(L) && !isnum(key)) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 72f5de0b056..6654de33853 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -60,8 +60,8 @@ if(CandCheck(ROLE_TRAITOR, applicant, temp)) candidates += applicant - if(candidates.len) - var/numTraitors = min(candidates.len, antnum) + if(length(candidates)) + var/numTraitors = min(length(candidates), antnum) for(var/i = 0, iError: create_xeno(): no suitable candidates.") if(!istext(ckey)) return 0 var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva") - var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin) + var/obj/effect/landmark/spawn_here = length(GLOB.xeno_spawn) ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin) var/mob/living/carbon/alien/new_xeno switch(alien_caste) if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen/large(spawn_here) diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm index b28f460e4f5..588064b21bd 100644 --- a/code/modules/antagonists/_common/antag_spawner.dm +++ b/code/modules/antagonists/_common/antag_spawner.dm @@ -203,7 +203,7 @@ type = "laughter" var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a [type] demon summoned by [user.real_name]?", ROLE_DEMON, TRUE, 10 SECONDS, source = demon_type) - if(candidates.len > 0) + if(length(candidates) > 0) var/mob/C = pick(candidates) spawn_antag(C, get_turf(src.loc), initial(demon_type.name), user) dust_if_respawnable(C) @@ -292,7 +292,7 @@ var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a magical morph awakened by [user.real_name]?", ROLE_MORPH, 1, 10 SECONDS, source = morph_type) - if(candidates.len > 0) + if(length(candidates) > 0) var/mob/C = pick(candidates) spawn_antag(C, get_turf(src.loc), initial(morph_type.name), user) dust_if_respawnable(C) diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index 1674c5729cf..a7115d0e929 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -64,8 +64,8 @@ //Recent as opposed to all because rounds tend to have a LOT of text. var/list/recent_speech = list() - if(target.say_log.len > CHANGELING_ABSORB_RECENT_SPEECH) - recent_speech = target.say_log.Copy(target.say_log.len-CHANGELING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list + if(length(target.say_log) > CHANGELING_ABSORB_RECENT_SPEECH) + recent_speech = target.say_log.Copy(length(target.say_log)-CHANGELING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list else recent_speech = target.say_log.Copy() diff --git a/code/modules/arcade/mob_hunt/mob_datums.dm b/code/modules/arcade/mob_hunt/mob_datums.dm index 2621201f086..fc60e17bbbe 100644 --- a/code/modules/arcade/mob_hunt/mob_datums.dm +++ b/code/modules/arcade/mob_hunt/mob_datums.dm @@ -65,10 +65,10 @@ /datum/mob_hunt/proc/select_spawn() var/list/possible_areas = get_possible_areas() - if(!possible_areas.len) + if(!length(possible_areas)) log_admin("No possible areas to spawn [type] found. Possible code/mapping error?") return 0 - while(possible_areas.len) + while(length(possible_areas)) //randomly select an area from our possible_areas list to try spawning in, then remove it from possible_areas so it won't get picked over and over forever. var/spawn_area_path = pickweight(possible_areas) var/area/spawn_area = locate(spawn_area_path) @@ -77,7 +77,7 @@ break //clear and generate a fresh list of turfs in the selected area, weighted based on white/black lists var/list/possible_turfs = get_possible_turfs(spawn_area) - if(!possible_turfs.len) //If we don't have any possible turfs, this attempt was a failure. Try again. + if(!length(possible_turfs)) //If we don't have any possible turfs, this attempt was a failure. Try again. continue //if we got this far, we're spawning on this attempt, hooray! spawn_point = pickweight(possible_turfs) diff --git a/code/modules/asset_cache/asset_list.dm b/code/modules/asset_cache/asset_list.dm index ead4accd836..1eb088800c6 100644 --- a/code/modules/asset_cache/asset_list.dm +++ b/code/modules/asset_cache/asset_list.dm @@ -311,7 +311,7 @@ GLOBAL_LIST_EMPTY(asset_datums) if(!asset) continue asset = fcopy_rsc(asset) //dedupe - var/prefix2 = (directions.len > 1) ? "[dir2text(direction)]." : "" + var/prefix2 = (length(directions) > 1) ? "[dir2text(direction)]." : "" var/asset_name = "[prefix].[prefix2][icon_state_name].png" if(generic_icon_names) asset_name = "[GENERATE_ASSET_NAME(asset)].png" diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 42dc9c3fb25..aae9e9ba296 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -247,7 +247,7 @@ if(falloff) max_dist = min((temp - (T0C + 60)) / falloff, radius) open[Ce] = 0 - while(open.len) + while(length(open)) var/turf/T = open[1] var/dist = open[T] open -= T diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index 1edf6db0921..a5cd8cd86a6 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -126,7 +126,7 @@ //cache for sanic speed var/list/adjacent_turfs = atmos_adjacent_turfs var/datum/excited_group/our_excited_group = excited_group - var/adjacent_turfs_length = adjacent_turfs.len + var/adjacent_turfs_length = length(adjacent_turfs) if(planetary_atmos) adjacent_turfs_length++ diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index cb62033952a..2c438e38d20 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -744,24 +744,24 @@ for(var/g in gas_names) thresholds += list(list("name" = gas_names[g], "settings" = list())) selected = TLV[g] - thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = "min2", "selected" = selected.min2)) - thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = "min1", "selected" = selected.min1)) - thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = "max1", "selected" = selected.max1)) - thresholds[thresholds.len]["settings"] += list(list("env" = g, "val" = "max2", "selected" = selected.max2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = g, "val" = "min2", "selected" = selected.min2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = g, "val" = "min1", "selected" = selected.min1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = g, "val" = "max1", "selected" = selected.max1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = g, "val" = "max2", "selected" = selected.max2)) selected = TLV["pressure"] thresholds += list(list("name" = "Pressure", "settings" = list())) - thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = "min2", "selected" = selected.min2)) - thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = "min1", "selected" = selected.min1)) - thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = "max1", "selected" = selected.max1)) - thresholds[thresholds.len]["settings"] += list(list("env" = "pressure", "val" = "max2", "selected" = selected.max2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "pressure", "val" = "min2", "selected" = selected.min2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "pressure", "val" = "min1", "selected" = selected.min1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "pressure", "val" = "max1", "selected" = selected.max1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "pressure", "val" = "max2", "selected" = selected.max2)) selected = TLV["temperature"] thresholds += list(list("name" = "Temperature", "settings" = list())) - thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "min2", "selected" = selected.min2)) - thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "min1", "selected" = selected.min1)) - thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1)) - thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "temperature", "val" = "min2", "selected" = selected.min2)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "temperature", "val" = "min1", "selected" = selected.min1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1)) + thresholds[length(thresholds)]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2)) return thresholds diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 52f39fb316e..4e696bc6025 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -253,7 +253,7 @@ data["beakerVolume"] = 0 if(beaker) data["beakerLabel"] = beaker.label_text ? beaker.label_text : null - if(beaker.reagents && beaker.reagents.reagent_list.len) + if(beaker.reagents && length(beaker.reagents.reagent_list)) for(var/datum/reagent/R in beaker.reagents.reagent_list) data["beakerVolume"] += R.volume data["cooldownProgress"] = round(clamp((world.time - last_injection) / injection_cooldown, 0, 1) * 100) diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index 7a4b3b77a12..3da561d9fcf 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -40,12 +40,12 @@ if(!air) air = new var/list/possible_expansions = list(base) - while(possible_expansions.len>0) + while(length(possible_expansions)>0) for(var/obj/machinery/atmospherics/borderline in possible_expansions) var/list/result = borderline.pipeline_expansion(src) - if(result.len>0) + if(length(result)>0) for(var/obj/machinery/atmospherics/P in result) if(istype(P, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/item = P @@ -186,7 +186,7 @@ var/list/datum/pipeline/PL = list() PL += src - for(var/i=1;i<=PL.len;i++) + for(var/i=1;i<=length(PL);i++) var/datum/pipeline/P = PL[i] if(!P) return diff --git a/code/modules/atmospherics/machinery/pipes/pipe.dm b/code/modules/atmospherics/machinery/pipes/pipe.dm index e2d946cfc3c..2d3eb724fe0 100644 --- a/code/modules/atmospherics/machinery/pipes/pipe.dm +++ b/code/modules/atmospherics/machinery/pipes/pipe.dm @@ -33,7 +33,7 @@ qdel(meter) // if we're somehow by ourself - if(parent && !QDELETED(parent) && parent.members.len == 1 && parent.members[1] == src) + if(parent && !QDELETED(parent) && length(parent.members) == 1 && parent.members[1] == src) qdel(parent) parent = null diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index 266eb53c815..faaeff82e9a 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -9,9 +9,9 @@ ..() var/list/things = params2list(loot) - if(things && things.len) + if(things && length(things)) for(var/i = lootcount, i > 0, i--) - if(!things.len) + if(!length(things)) return var/loot_spawn = pick(things) diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index ae543a4f967..7a0a2d52edc 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -98,18 +98,18 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) var/list/gridLines = splittext(dmmRegex.group[6], "\n") var/leadingBlanks = 0 - while(leadingBlanks < gridLines.len && gridLines[++leadingBlanks] == "") + while(leadingBlanks < length(gridLines) && gridLines[++leadingBlanks] == "") if(leadingBlanks > 1) gridLines.Cut(1, leadingBlanks) // Remove all leading blank lines. - if(!gridLines.len) // Skip it if only blank lines exist. + if(!length(gridLines)) // Skip it if only blank lines exist. continue - if(gridLines.len && gridLines[gridLines.len] == "") - gridLines.Cut(gridLines.len) // Remove only one blank line at the end. + if(length(gridLines) && gridLines[length(gridLines)] == "") + gridLines.Cut(length(gridLines)) // Remove only one blank line at the end. bounds[MAP_MINY] = min(bounds[MAP_MINY], ycrd) - ycrd += gridLines.len - 1 // Start at the top and work down + ycrd += length(gridLines) - 1 // Start at the top and work down if(!shouldCropMap && ycrd > world.maxy) if(!measureOnly) @@ -253,7 +253,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) // The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile // first instance the /area and remove it from the members list - index = members.len + index = length(members) var/turf/crds = locate(xcrd, ycrd, zcrd) if(members[index] != /area/template_noop) @@ -285,7 +285,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) if(T) // if others /turf are presents, simulates the underlays piling effect index = first_turf_index + 1 - var/mlen = members.len - 1 + var/mlen = length(members) - 1 while(index <= mlen) // Last item is an /area var/underlay if(isturf(T)) // I blame this on the stupid clown who coded the BYOND map editor @@ -432,7 +432,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) var/json_ready = 0 /datum/dmm_suite/preloader/proc/setup(list/the_attributes, path) - if(the_attributes.len) + if(length(the_attributes)) json_ready = 0 if("map_json_data" in the_attributes) json_ready = 1 diff --git a/code/modules/buildmode/submodes/link.dm b/code/modules/buildmode/submodes/link.dm index dfe986b0d01..f3424124882 100644 --- a/code/modules/buildmode/submodes/link.dm +++ b/code/modules/buildmode/submodes/link.dm @@ -54,7 +54,7 @@ speed_execute() return if(!M.normaldoorcontrol) - if(link_lines.len && alert(user, "Warning: This will disable links to connected pod doors. Continue?", "Buildmode", "Yes", "No") == "No") + if(length(link_lines) && alert(user, "Warning: This will disable links to connected pod doors. Continue?", "Buildmode", "Yes", "No") == "No") speed_execute() return M.normaldoorcontrol = TRUE @@ -76,7 +76,7 @@ speed_execute() return if(M.normaldoorcontrol) - if(link_lines.len && alert(user, "Warning: This will disable links to connected airlocks. Continue?", "Buildmode", "Yes", "No") == "No") + if(length(link_lines) && alert(user, "Warning: This will disable links to connected airlocks. Continue?", "Buildmode", "Yes", "No") == "No") speed_execute() return M.normaldoorcontrol = FALSE diff --git a/code/modules/client/preference/link_processing.dm b/code/modules/client/preference/link_processing.dm index 7dbf65fa62e..b7c832a9952 100644 --- a/code/modules/client/preference/link_processing.dm +++ b/code/modules/client/preference/link_processing.dm @@ -807,11 +807,11 @@ var/datum/robolimb/L = new limb_type() if(limb in L.parts) //Make sure that only models that provide the parts the user needs populate the list. robolimb_models[L.company] = L - if(robolimb_models.len == 1) //If there's only one model available in the list, autoselect it to avoid having to bother the user with a dialog that provides only one option. + if(length(robolimb_models) == 1) //If there's only one model available in the list, autoselect it to avoid having to bother the user with a dialog that provides only one option. subchoice = L.company //If there ends up being more than one model populating the list, subchoice will be overwritten later anyway, so this isn't a problem. if(second_limb in L.parts) //If the child limb of the limb the user selected is also present in the model's parts list, state it's been found so the second limb can be set later. in_model = 1 - if(robolimb_models.len > 1) //If there's more than one model in the list that can provide the part the user wants, let them choose. + if(length(robolimb_models) > 1) //If there's more than one model in the list that can provide the part the user wants, let them choose. subchoice = tgui_input_list(user, "Which model of [choice] [limb_name] do you wish to use?", "[limb_name] - Prosthesis - Model", robolimb_models) if(subchoice) choice = subchoice diff --git a/code/modules/client/preference/loadout/gear_tweaks.dm b/code/modules/client/preference/loadout/gear_tweaks.dm index 2dbda39a926..459279c6175 100644 --- a/code/modules/client/preference/loadout/gear_tweaks.dm +++ b/code/modules/client/preference/loadout/gear_tweaks.dm @@ -81,14 +81,14 @@ /datum/gear_tweak/contents/get_default() . = list() - for(var/i = 1 to valid_contents.len) + for(var/i = 1 to length(valid_contents)) . += "Random" /datum/gear_tweak/contents/get_metadata(user, list/metadata) . = list() - for(var/i = metadata.len to valid_contents.len) + for(var/i = length(metadata) to length(valid_contents)) metadata += "Random" - for(var/i = 1 to valid_contents.len) + for(var/i = 1 to length(valid_contents)) var/entry = input(user, "Choose an entry.", "Character Preference", metadata[i]) as null|anything in (valid_contents[i] + list("Random", "None")) if(entry) . += entry @@ -96,9 +96,9 @@ return metadata /datum/gear_tweak/contents/tweak_item(obj/item/I, list/metadata) - if(metadata.len != valid_contents.len) + if(length(metadata) != length(valid_contents)) return - for(var/i = 1 to valid_contents.len) + for(var/i = 1 to length(valid_contents)) var/path var/list/contents = valid_contents[i] if(metadata[i] == "Random") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 56b896f9379..5f230c1a48e 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -826,7 +826,7 @@ data["accessories"] = accessories_list for(var/obj/item/clothing/accessory/A in accessories) accessories_list.len++ - accessories_list[accessories_list.len] = A.serialize() + accessories_list[length(accessories_list)] = A.serialize() return data diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 276f49e03e8..19cc8dbd095 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -815,10 +815,10 @@ item_color = "corset_blue" /proc/english_accessory_list(obj/item/clothing/under/U) - if(!istype(U) || !U.accessories.len) + if(!istype(U) || !length(U.accessories)) return var/list/A = U.accessories - var/total = A.len + var/total = length(A) if(total == 1) return "\a [A[1]]" else if(total == 2) diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 2c3c0d11512..ad25bf04f7b 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -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 diff --git a/code/modules/detective_work/evidence.dm b/code/modules/detective_work/evidence.dm index 104e1130d23..a8b7d047825 100644 --- a/code/modules/detective_work/evidence.dm +++ b/code/modules/detective_work/evidence.dm @@ -33,7 +33,7 @@ to_chat(user, "[I] won't fit in [src].") return - if(contents.len) + if(length(contents)) to_chat(user, "[src] already has something inside it.") return @@ -66,7 +66,7 @@ return 1 /obj/item/evidencebag/attack_self(mob/user) - if(contents.len) + if(length(contents)) var/obj/item/I = contents[1] user.visible_message("[user] takes [I] out of [src].", "You take [I] out of [src].",\ "You hear someone rustle around in a plastic bag, and remove something.") diff --git a/code/modules/economy/economy_events/economy_events.dm b/code/modules/economy/economy_events/economy_events.dm index b8f37e99fc9..63a65958c1d 100644 --- a/code/modules/economy/economy_events/economy_events.dm +++ b/code/modules/economy/economy_events/economy_events.dm @@ -8,7 +8,7 @@ /datum/event/economic_event/start() affected_dest = pickweight(GLOB.weighted_randomevent_locations) - if(affected_dest.viable_random_events.len) + if(length(affected_dest.viable_random_events)) endWhen = rand(60,300) event_type = pick(affected_dest.viable_random_events) diff --git a/code/modules/economy/economy_events/economy_events_mundane.dm b/code/modules/economy/economy_events/economy_events_mundane.dm index f9974c1ca29..4085f1c4e6c 100644 --- a/code/modules/economy/economy_events/economy_events_mundane.dm +++ b/code/modules/economy/economy_events/economy_events_mundane.dm @@ -5,7 +5,7 @@ /datum/event/mundane_news/announce() var/datum/trade_destination/affected_dest = pickweight(GLOB.weighted_mundaneevent_locations) var/event_type = 0 - if(affected_dest.viable_mundane_events.len) + if(length(affected_dest.viable_mundane_events)) event_type = pick(affected_dest.viable_mundane_events) if(!event_type) diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index 2ecb9e20e86..475610825f3 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -99,7 +99,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) // I apologize in advance var/list/splitlines = splittext(e.desc, "\n") var/list/desclines = list() - if(splitlines.len > 2) // If there aren't at least three lines, there's no info + if(length(splitlines) > 2) // If there aren't at least three lines, there's no info for(var/line in splitlines) if(length(line) < 3) continue // Blank line, skip it diff --git a/code/modules/events/abductor_event.dm b/code/modules/events/abductor_event.dm index 0557f3f131f..aef93f7ef78 100644 --- a/code/modules/events/abductor_event.dm +++ b/code/modules/events/abductor_event.dm @@ -11,7 +11,7 @@ /datum/event/abductor/proc/makeAbductorTeam() var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for an Abductor Team?", ROLE_ABDUCTOR, TRUE) - if(candidates.len >= 2) + if(length(candidates) >= 2) //Oh god why we can't have static functions var/number = SSticker.mode.abductor_teams + 1 diff --git a/code/modules/events/blob/blob_powers.dm b/code/modules/events/blob/blob_powers.dm index b5e8492a3a8..d8bf6e3765e 100644 --- a/code/modules/events/blob/blob_powers.dm +++ b/code/modules/events/blob/blob_powers.dm @@ -22,9 +22,9 @@ set name = "Jump to Node" set desc = "Transport back to a selected node." - if(GLOB.blob_nodes.len) + if(length(GLOB.blob_nodes)) var/list/nodes = list() - for(var/i = 1; i <= GLOB.blob_nodes.len; i++) + for(var/i = 1; i <= length(GLOB.blob_nodes); i++) var/obj/structure/blob/node/B = GLOB.blob_nodes[i] nodes["Blob Node #[i] ([get_location_name(B)])"] = B var/node_name = tgui_input_list(src, "Choose a node to jump to.", "Node Jump", nodes) @@ -362,7 +362,7 @@ to_chat(src, "You rally your spores.") var/list/surrounding_turfs = block(locate(T.x - 1, T.y - 1, T.z), locate(T.x + 1, T.y + 1, T.z)) - if(!surrounding_turfs.len) + if(!length(surrounding_turfs)) return for(var/mob/living/simple_animal/hostile/blob/blobspore/BS in GLOB.alive_mob_list) diff --git a/code/modules/events/blob/blob_structures/factory.dm b/code/modules/events/blob/blob_structures/factory.dm index 8f5930fb2d2..6bbf5d34f59 100644 --- a/code/modules/events/blob/blob_structures/factory.dm +++ b/code/modules/events/blob/blob_structures/factory.dm @@ -16,7 +16,7 @@ return ..() /obj/structure/blob/factory/run_action() - if(spores.len >= max_spores) + if(length(spores) >= max_spores) return if(spore_delay > world.time) return diff --git a/code/modules/events/blob/theblob.dm b/code/modules/events/blob/theblob.dm index bc06566df54..c8d6f3da473 100644 --- a/code/modules/events/blob/theblob.dm +++ b/code/modules/events/blob/theblob.dm @@ -114,7 +114,7 @@ GLOBAL_LIST_EMPTY(blob_minions) var/list/dirs = list(1,2,4,8) dirs.Remove(origin_dir)//Dont pulse the guy who pulsed us for(var/i = 1 to 4) - if(!dirs.len) break + if(!length(dirs)) break var/dirn = pick(dirs) dirs.Remove(dirn) var/turf/T = get_step(src, dirn) diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index c38d2c2e25c..d63270785c6 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -21,7 +21,7 @@ /datum/event/carp_migration/start() if(severity == EVENT_LEVEL_MAJOR) - spawn_fish(GLOB.landmarks_list.len) + spawn_fish(length(GLOB.landmarks_list)) else if(severity == EVENT_LEVEL_MODERATE) spawn_fish(rand(4, 6)) //12 to 30 carp, in small groups else @@ -33,7 +33,7 @@ for(var/thing in GLOB.carplist) spawn_locations.Add(get_turf(thing)) spawn_locations = shuffle(spawn_locations) - num_groups = min(num_groups, spawn_locations.len) + num_groups = min(num_groups, length(spawn_locations)) var/i = 1 while(i <= num_groups) diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index f9f61e7232b..8eba69e9802 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -13,12 +13,12 @@ for(var/obj/effect/landmark/lightsout/newEpicentre in GLOB.landmarks_list) if(!(newEpicentre in epicentreList)) possibleEpicentres += newEpicentre - if(possibleEpicentres.len) + if(length(possibleEpicentres)) epicentreList += pick(possibleEpicentres) else break - if(!epicentreList.len) + if(!length(epicentreList)) return for(var/thing in epicentreList) diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index f2490d10c32..250a6089130 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -58,7 +58,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) /datum/event_container/proc/acquire_event() - if(available_events.len == 0) + if(length(available_events) == 0) return var/active_with_role = number_active_with_role() @@ -79,7 +79,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) else possible_events -= event_meta - if(possible_events.len == 0) + if(length(possible_events) == 0) return null // Select an event and remove it from the pool of available events @@ -97,7 +97,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) // Otherwise, follow the standard setup process else var/playercount_modifier = 1 - switch(GLOB.player_list.len) + switch(length(GLOB.player_list)) if(0 to 10) playercount_modifier = 1.2 if(11 to 15) diff --git a/code/modules/events/event_procs.dm b/code/modules/events/event_procs.dm index c5ded25b5f0..d0af4971ec2 100644 --- a/code/modules/events/event_procs.dm +++ b/code/modules/events/event_procs.dm @@ -64,7 +64,7 @@ active_with_role["Cyborg"] = 0 active_with_role["Janitor"] = 0 active_with_role["Botanist"] = 0 - active_with_role["Any"] = GLOB.player_list.len + active_with_role["Any"] = length(GLOB.player_list) for(var/mob/M in GLOB.player_list) if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 130e1410b52..a7e3a48439b 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -502,7 +502,7 @@ continue players += player.real_name var/random_player = "The Captain" - if(players.len) + if(length(players)) random_player = pick(players) //Random player's name, to be used in laws. var/random_department = "Science" diff --git a/code/modules/events/money_spam.dm b/code/modules/events/money_spam.dm index 12d870cbf31..c6988e16471 100644 --- a/code/modules/events/money_spam.dm +++ b/code/modules/events/money_spam.dm @@ -35,7 +35,7 @@ continue viables.Add(check_pda) - if(!viables.len) + if(!length(viables)) return var/obj/item/pda/P = pick(viables) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index a31683fe1f8..637dd3a254c 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -44,7 +44,7 @@ if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType)) areas += A - if(areas && areas.len > 0) + if(areas && length(areas) > 0) var/my_department = "[station_name()] firewall subroutines" var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [station_time_timestamp()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.
    " for(var/obj/machinery/message_server/MS in GLOB.machines) @@ -58,7 +58,7 @@ /datum/event/prison_break/tick() if(activeFor == releaseWhen) - if(areas && areas.len > 0) + if(areas && length(areas) > 0) for(var/area/A in areas) for(var/obj/machinery/light/L in A) L.forced_flicker(10) diff --git a/code/modules/events/rogue_drones.dm b/code/modules/events/rogue_drones.dm index 281a085dfe1..c4fe2d40650 100644 --- a/code/modules/events/rogue_drones.dm +++ b/code/modules/events/rogue_drones.dm @@ -38,7 +38,7 @@ qdel(D) num_recovered++ - if(num_recovered > drones_list.len * 0.75) + if(num_recovered > length(drones_list) * 0.75) GLOB.minor_announcement.Announce("Icarus drone control reports the malfunctioning wing has been recovered safely.", "Rogue drone alert") else GLOB.minor_announcement.Announce("Icarus drone control registers disappointment at the loss of the drones, but the survivors have been recovered.", "Rogue drone alert") diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index b8403cef9c3..94c5f21a236 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -10,12 +10,12 @@ qdel(SV) - if(turfs.len) //Pick a turf to spawn at if we can + if(length(turfs)) //Pick a turf to spawn at if we can var/turf/T = pick(turfs) var/obj/structure/spacevine_controller/SC = new /obj/structure/spacevine_controller(T, null, rand(30,70),rand(5,2)) //spawn a controller at turf // Make the event start fun - give the vine a random hostile mutation - if(SC.vines.len) + if(length(SC.vines)) SV = SC.vines[1] var/list/mutations = subtypesof(/datum/spacevine_mutation) while(mutations) @@ -429,7 +429,7 @@ if(master) master.vines -= src master.growth_queue -= src - if(!master.vines.len) + if(!length(master.vines)) var/obj/item/seeds/kudzu/KZ = new(loc) for(var/mutation in mutations) KZ.mutations += mutation @@ -591,7 +591,7 @@ SM.on_birth(SV) /obj/structure/spacevine_controller/process() - if(!vines || !vines.len) + if(!vines || !length(vines)) qdel(src) //space vines exterminated. Remove the controller return if(!growth_queue) @@ -600,7 +600,7 @@ var/length = 0 - length = min( spread_cap , max( 1 , vines.len / spread_multiplier ) ) + length = min( spread_cap , max( 1 , length(vines) / spread_multiplier ) ) var/i = 0 var/list/obj/structure/spacevine/queue_end = list() @@ -663,7 +663,7 @@ for(var/SM_type in mutations) var/datum/spacevine_mutation/SM = mutations[SM_type] spread_search |= SM.on_search(src) - while(dir_list.len) + while(length(dir_list)) var/direction = pick(dir_list) dir_list -= direction var/turf/stepturf = get_step(src,direction) diff --git a/code/modules/events/traders.dm b/code/modules/events/traders.dm index 384978c872f..3b1427bed87 100644 --- a/code/modules/events/traders.dm +++ b/code/modules/events/traders.dm @@ -10,7 +10,7 @@ GLOBAL_LIST_INIT(unused_trade_stations, list("sol")) var/list/trader_objectives = list() /datum/event/traders/setup() - if(GLOB.unused_trade_stations.len) + if(length(GLOB.unused_trade_stations)) station = pick_n_take(GLOB.unused_trade_stations) /datum/event/traders/fake_announce() @@ -34,7 +34,7 @@ GLOBAL_LIST_INIT(unused_trade_stations, list("sol")) var/list/spawnlocs = list() for(var/obj/effect/landmark/spawner/soltrader/S in GLOB.landmarks_list) spawnlocs += get_turf(S) - if(!spawnlocs.len) + if(!length(spawnlocs)) return trader_objectives = forge_trader_objectives() diff --git a/code/modules/events/undead_event.dm b/code/modules/events/undead_event.dm index 4685cefffce..3b79018b9c0 100644 --- a/code/modules/events/undead_event.dm +++ b/code/modules/events/undead_event.dm @@ -25,9 +25,9 @@ if(okay) turflist += T - if(!turflist.len) continue - var/turfs = round(turflist.len * spawn_prob/100,1) - while(turfs > 0 && turflist.len) // safety + if(!length(turflist)) continue + var/turfs = round(length(turflist) * spawn_prob/100,1) + while(turfs > 0 && length(turflist)) // safety turfs-- var/turf/T = pick_n_take(turflist) var/undeadtype = pick(/mob/living/simple_animal/hostile/retaliate/skeleton, diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm index 2bacfbac964..793f0c83b63 100644 --- a/code/modules/events/vent_clog.dm +++ b/code/modules/events/vent_clog.dm @@ -12,7 +12,7 @@ endWhen = rand(25, 100) for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in GLOB.machines) if(is_station_level(temp_vent.loc.z)) - if(temp_vent.parent.other_atmosmch.len > 50) + if(length(temp_vent.parent.other_atmosmch) > 50) vents += temp_vent /datum/event/vent_clog/tick() diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm index 9bb4b88ae1c..855989a13a1 100644 --- a/code/modules/events/wormholes.dm +++ b/code/modules/events/wormholes.dm @@ -52,7 +52,7 @@ return FALSE var/turf/target - if(GLOB.portals.len) + if(length(GLOB.portals)) var/obj/effect/portal/P = pick(GLOB.portals) if(P && isturf(P.loc)) target = P.loc diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index a5aaa9280cd..f2b392d091d 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -10,14 +10,14 @@ for(var/i in 1 to rand(3, rand(5, 10))) dream_images += pick_n_take(dreams) dreaming++ - for(var/i in 1 to dream_images.len) + for(var/i in 1 to length(dream_images)) addtimer(CALLBACK(src, PROC_REF(experience_dream), dream_images[i], FALSE), ((i - 1) * rand(30,60))) return TRUE /mob/living/carbon/proc/custom_dreams(list/dreamlist, mob/user) var/list/newlist = dreamlist.Copy() - for(var/i in 1 to newlist.len) + for(var/i in 1 to length(newlist)) newlist[i] = replacetext(newlist[i], "DREAMER", "[user.name]") return newlist @@ -32,7 +32,7 @@ for(var/i in 1 to rand(3, rand(5, 10))) dream_images += pick_n_take(nightmares) nightmare++ - for(var/i in 1 to dream_images.len) + for(var/i in 1 to length(dream_images)) addtimer(CALLBACK(src, PROC_REF(experience_dream), dream_images[i], TRUE), ((i - 1) * rand(30,60))) return TRUE diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm index 4baba043cf1..d9c7654729b 100644 --- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm +++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm @@ -35,7 +35,7 @@ var/datum/bottler_recipe/recipe = new type if(recipe.result) // Ignore recipe subtypes that lack a result available_recipes += recipe - for(var/i = 1, i <= recipe.ingredients.len, i++) + for(var/i = 1, i <= length(recipe.ingredients), i++) acceptable_items |= recipe.ingredients[i] else qdel(recipe) @@ -95,7 +95,7 @@ to_chat(user, "[src] is full, please remove or process the contents first.") return var/slot_inserted = 0 - for(var/i = 1, i <= slots.len, i++) + for(var/i = 1, i <= length(slots), i++) if(!slots[i]) slots[i] = O slot_inserted = i @@ -111,7 +111,7 @@ /obj/machinery/bottler/proc/eject_items(slot) var/obj/item/O = null if(!slot) - for(var/i = 1, i <= slots.len, i++) + for(var/i = 1, i <= length(slots), i++) if(slots[i]) O = slots[i] O.forceMove(loc) @@ -205,7 +205,7 @@ /obj/machinery/bottler/proc/select_recipe() for(var/datum/bottler_recipe/recipe in available_recipes) var/number_matches = 0 - for(var/i = 1, i <= slots.len, i++) + for(var/i = 1, i <= length(slots), i++) var/obj/item/O = slots[i] if(istype(O, recipe.ingredients[i])) number_matches++ @@ -335,7 +335,7 @@ dat += "" dat += "" - for(var/i = 1, i <= slots.len, i++) + for(var/i = 1, i <= length(slots), i++) var/obj/O = slots[i] if(O) dat += "[bicon(O)]
    [O.name]" @@ -349,7 +349,7 @@ dat += "" dat += "" - for(var/i = 1, i <= slots.len, i++) + for(var/i = 1, i <= length(slots), i++) if(slots[i]) dat += "Eject" else diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index 35f67923976..66a06e0b0d4 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -40,7 +40,7 @@ /obj/item/reagent_containers/drinks/drinkingglass/on_reagent_change() overlays.Cut() - if(reagents.reagent_list.len) + if(length(reagents.reagent_list)) var/datum/reagent/R = reagents.get_master_reagent() name = R.drink_name desc = R.drink_desc diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index 49408392340..4f552f3d360 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -96,9 +96,9 @@ to_chat(user, "You transfer [trans] units of the condiment to [target].") /obj/item/reagent_containers/condiment/on_reagent_change() - if(!possible_states.len) + if(!length(possible_states)) return - if(reagents.reagent_list.len > 0) + if(length(reagents.reagent_list) > 0) var/main_reagent = reagents.get_master_reagent_id() if(main_reagent in possible_states) var/list/temp_list = possible_states[main_reagent] @@ -110,7 +110,7 @@ name = "[originalname] bottle" main_reagent = reagents.get_master_reagent_name() desc = "Looks like it is [lowertext(main_reagent)], but you are not sure." - if(reagents.reagent_list.len==1) + if(length(reagents.reagent_list)==1) desc = "A mixture of various condiments. [lowertext(main_reagent)] is one of them." icon_state = "mixedcondiments" else @@ -332,7 +332,7 @@ qdel(src) /obj/item/reagent_containers/condiment/pack/on_reagent_change() - if(reagents.reagent_list.len > 0) + if(length(reagents.reagent_list) > 0) var/main_reagent = reagents.get_master_reagent_id() if(main_reagent in possible_states) var/list/temp_list = possible_states[main_reagent] diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index 00339c2d31a..a748cdfe490 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -481,15 +481,15 @@ do {\ for(var/ings in sorteditems) //add the non-basename items to the name, sorting out the , and the and c++ - if(c == sorteditems.len - 1) + if(c == length(sorteditems) - 1) seperator = " and " - else if(c == sorteditems.len) + else if(c == length(sorteditems)) seperator = " " else seperator = ", " - if(sorteditems[ings] > levels.len) - sorteditems[ings] = levels.len + if(sorteditems[ings] > length(levels)) + sorteditems[ings] = length(levels) if(sorteditems[ings] <= 1) sendback +="[ings][seperator]" @@ -497,10 +497,10 @@ do {\ sendback +="[levels[sorteditems[ings]]] [ings][seperator]" for(var/ingtype in sortedtypes) // now add the types basenames, keeping the src one seperate so it can go on the end - if(sortedtypes[ingtype] > levels.len) - sortedtypes[ingtype] = levels.len + if(sortedtypes[ingtype] > length(levels)) + sortedtypes[ingtype] = length(levels) if(ingtype == basename) - if(sortedtypes[ingtype] < levels.len) + if(sortedtypes[ingtype] < length(levels)) sortedtypes[ingtype]++ endpart = "[levels[sortedtypes[ingtype]]] decker [basename]" continue diff --git a/code/modules/food_and_drinks/food/foods/pizza.dm b/code/modules/food_and_drinks/food/foods/pizza.dm index d2bda7925fb..9cdc5cddb6f 100644 --- a/code/modules/food_and_drinks/food/foods/pizza.dm +++ b/code/modules/food_and_drinks/food/foods/pizza.dm @@ -268,9 +268,9 @@ . = ..() if(open && pizza) desc = "A box suited for pizzas. It appears to have a [pizza.name] inside." - else if(boxes.len > 0) - desc = "A pile of boxes suited for pizzas. There appears to be [boxes.len + 1] boxes in the pile." - var/obj/item/pizzabox/top_box = boxes[boxes.len] + else if(length(boxes) > 0) + desc = "A pile of boxes suited for pizzas. There appears to be [length(boxes) + 1] boxes in the pile." + var/obj/item/pizzabox/top_box = boxes[length(boxes)] var/top_tag = top_box.box_tag if(top_tag != "") desc = "[desc] The box on top has a tag, it reads: '[top_tag]'." @@ -298,8 +298,8 @@ else // Stupid code because byondcode sucks var/set_tag = TRUE - if(boxes.len > 0) - var/obj/item/pizzabox/top_box = boxes[boxes.len] + if(length(boxes) > 0) + var/obj/item/pizzabox/top_box = boxes[length(boxes)] if(top_box.box_tag != "") set_tag = TRUE else @@ -307,7 +307,7 @@ set_tag = TRUE if(!open && set_tag) var/image/tag = image("food/pizza.dmi", icon_state = "pizzabox_tag") - tag.pixel_y = boxes.len * 3 + tag.pixel_y = length(boxes) * 3 . += tag /obj/item/pizzabox/attack_hand(mob/user) @@ -318,11 +318,11 @@ update_appearance(UPDATE_DESC|UPDATE_ICON) return - if(boxes.len > 0) + if(length(boxes) > 0) if(user.is_in_inactive_hand(src)) ..() return - var/obj/item/pizzabox/box = boxes[boxes.len] + var/obj/item/pizzabox/box = boxes[length(boxes)] boxes -= box user.put_in_hands(box) to_chat(user, "You remove the topmost [src] from your hand.") @@ -339,7 +339,7 @@ update_appearance(UPDATE_DESC|UPDATE_ICON) /obj/item/pizzabox/attack_self(mob/user) - if(boxes.len > 0) + if(length(boxes) > 0) return open = !open if(open && pizza) @@ -355,7 +355,7 @@ boxestoadd += box for(var/obj/item/pizzabox/i in box.boxes) boxestoadd += i - if((boxes.len+1) + boxestoadd.len <= 5) + if((boxes.len+1) + length(boxestoadd) <= 5) user.drop_item() box.loc = src box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit @@ -389,8 +389,8 @@ if(!t) return var/obj/item/pizzabox/boxtotagto = src - if(boxes.len > 0) - boxtotagto = boxes[boxes.len] + if(length(boxes) > 0) + boxtotagto = boxes[length(boxes)] boxtotagto.box_tag = copytext("[t]", 1, 30) update_appearance(UPDATE_DESC|UPDATE_ICON) return diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 52d69b2eaa8..cccfab34edc 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -92,7 +92,7 @@ var/obj/item/kitchen/utensil/U = W - if(U.contents.len >= U.max_contents) + if(length(U.contents) >= U.max_contents) to_chat(user, "You cannot fit anything else on your [U].") return diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 8ad20838c4e..5896e70e42d 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -349,7 +349,7 @@ RefreshParts() /obj/machinery/gibber/autogibber/process() - if(!lturf || occupant || locked || operating || victim_targets.len) + if(!lturf || occupant || locked || operating || length(victim_targets)) return if(acceptdir != lastacceptdir) @@ -362,7 +362,7 @@ for(var/mob/living/carbon/human/H in lturf) victim_targets += H - if(victim_targets.len) + if(length(victim_targets)) visible_message({"\The [src] states, "Food detected!""}) sleep(consumption_delay) for(var/mob/living/carbon/H in victim_targets) diff --git a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm index 06597129b2e..2058df28982 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm @@ -250,7 +250,7 @@ var/list/recipes_to_make = choose_recipes() - if(recipes_to_make.len == 1 && recipes_to_make[1][2] == RECIPE_FAIL) + if(length(recipes_to_make) == 1 && recipes_to_make[1][2] == RECIPE_FAIL) //This only runs if there is a single recipe source to be made and it is a failure (the machine was loaded with only 1 mixing bowl that results in failure OR was directly loaded with ingredients that results in failure). //If there are multiple sources, this bit gets skipped. dirty += 1 @@ -305,7 +305,7 @@ var/datum/recipe/recipe_src = select_recipe(GLOB.cooking_recipes[recipe_type], src, ignored_items = list(/obj/item/mixing_bowl)) //check the machine's directly-inserted ingredients for possible recipes as well, ignoring the mixing bowls when selecting recipe if(recipe_src) //if we found a valid recipe for directly-inserted ingredients, add that to our list recipes_to_make.Add(list(list(src, recipe_src))) - else if(!recipes_to_make.len) //if the machine has no mixing bowls to make recipes from AND also doesn't have a valid recipe of directly-inserted ingredients, return a failure so we can make a burned mess + else if(!length(recipes_to_make)) //if the machine has no mixing bowls to make recipes from AND also doesn't have a valid recipe of directly-inserted ingredients, return a failure so we can make a burned mess recipes_to_make.Add(list(list(src, RECIPE_FAIL))) return recipes_to_make diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index 41b5cf9bcc2..5514f6fb545 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -233,7 +233,7 @@ to_chat(user, "\the [src] is already processing something!") return 1 - if(contents.len == 0) + if(length(contents) == 0) to_chat(user, "\the [src] is empty.") return 1 processing = TRUE diff --git a/code/modules/games/tarot.dm b/code/modules/games/tarot.dm index da99f76b2fd..eba209dd892 100644 --- a/code/modules/games/tarot.dm +++ b/code/modules/games/tarot.dm @@ -17,7 +17,7 @@ var/mob/living/user = usr if(cooldown < world.time - 1 SECONDS) var/list/newcards = list() - while(cards.len) + while(length(cards)) var/datum/playingcard/P = pick(cards) P.name = replacetext(P.name," reversed","") if(prob(50)) diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 3df3c4f5c3e..01fb9c6111b 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -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 @@ . += "There is no queen bee! There won't bee any honeycomb without a queen!" var/half_bee = get_max_bees()*0.5 - if(half_bee && (bees.len >= half_bee)) + if(half_bee && (length(bees) >= half_bee)) . += "This place is a BUZZ with activity... there are lots of bees!" . += "[bee_resources]/100 resource supply." . += "[bee_resources]% towards a new honeycomb." . += "[bee_resources*2]% towards a new bee." - if(honeycombs.len) - var/plural = honeycombs.len > 1 - . += "There [plural? "are" : "is"] [honeycombs.len] uncollected honeycomb[plural ? "s":""] in the apiary." + if(length(honeycombs)) + var/plural = length(honeycombs) > 1 + . += "There [plural? "are" : "is"] [length(honeycombs)] uncollected honeycomb[plural ? "s":""] in the apiary." - if(honeycombs.len >= get_max_honeycomb()) + if(length(honeycombs) >= get_max_honeycomb()) . += "there's no room for more honeycomb!" /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("[user] adds a frame to the apiary.") @@ -227,7 +227,7 @@ return switch(option) if("Remove a Honey Frame") - if(!honey_frames.len) + if(!length(honey_frames)) to_chat(user, "There are no honey frames to remove!") 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)) diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index 415e06f5dc9..48f7ef5358d 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -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() diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index 2ceca3a04fe..50e08b83566 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -37,7 +37,7 @@ return var/list/L = get_destinations(user) - if(!L.len) + if(!length(L)) to_chat(user, "[src] found no beacons in the world to anchor a wormhole to.") return var/chosen_beacon = pick(L) diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index f8dbebab453..11bec33326e 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -24,7 +24,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) if(EP.beacon_network in beacon_networks) possible_beacons += EP - if(!possible_beacons.len) + if(!length(possible_beacons)) to_chat(user, "There are no extraction beacons in existence!") return diff --git a/code/modules/mining/lavaland/loot/colossus_loot.dm b/code/modules/mining/lavaland/loot/colossus_loot.dm index 44423056c45..7c2002d2706 100644 --- a/code/modules/mining/lavaland/loot/colossus_loot.dm +++ b/code/modules/mining/lavaland/loot/colossus_loot.dm @@ -139,7 +139,7 @@ if(O.air) var/datum/gas_mixture/G = O.air G.copy_from(O.air) - if(prob(florachance) && NewFlora.len && !is_blocked_turf(O)) + if(prob(florachance) && length(NewFlora) && !is_blocked_turf(O)) var/atom/Picked = pick(NewFlora) new Picked(O) continue diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 6f9a0885d28..13c348d1ef8 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -192,7 +192,7 @@ generate_mineral(alloy.build_path) /obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D) - if(D.make_reagents.len) + if(length(D.make_reagents)) return FALSE var/build_amount = SMELT_AMOUNT diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm index 070713dd758..fcd5f801580 100644 --- a/code/modules/mining/minebot.dm +++ b/code/modules/mining/minebot.dm @@ -195,7 +195,7 @@ O.forceMove(src) /mob/living/simple_animal/hostile/mining_drone/proc/DropOre(message = 1) - if(!contents.len) + if(!length(contents)) if(message) to_chat(src, "You attempt to dump your stored ore, but you have none.") return diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index c00b0667daa..b8d064d5d0c 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -177,8 +177,8 @@ message = strip_html_properly(message) var/list/punctuation = list(",", "!", ".", ";", "?") var/list/messages = splittext(message, " ") - if(messages.len > 0) - var/R = rand(1, messages.len) + if(length(messages) > 0) + var/R = rand(1, length(messages)) var/heardword = messages[R] if(copytext(heardword,1, 1) in punctuation) heardword = copytext(heardword,2) diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm index 9994faf145a..33ded157189 100644 --- a/code/modules/mob/language.dm +++ b/code/modules/mob/language.dm @@ -24,7 +24,7 @@ var/join_override /datum/language/proc/get_random_name(gender, name_count=2, syllable_count=4) - if(!syllables || !syllables.len || english_names) + if(!syllables || !length(syllables) || english_names) if(gender==FEMALE) return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else @@ -43,7 +43,7 @@ /datum/language/proc/scramble(input) - if(!syllables || !syllables.len) + if(!syllables || !length(syllables)) return stars(input) // If the input is cached already, move it to the end of the cache and return it @@ -82,8 +82,8 @@ // Add it to cache, cutting old entries if the list is too long scramble_cache[input] = scrambled_text - if(scramble_cache.len > SCRAMBLE_CACHE_LEN) - scramble_cache.Cut(1, scramble_cache.len-SCRAMBLE_CACHE_LEN-1) + if(length(scramble_cache) > SCRAMBLE_CACHE_LEN) + scramble_cache.Cut(1, length(scramble_cache)-SCRAMBLE_CACHE_LEN-1) return scrambled_text diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index fffd5c5e98e..41a63358c21 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -84,7 +84,7 @@ // he will become the alien but if he doesn't then we will set the stage // to 2, so we don't do a process heavy check everytime. - if(candidates.len) + if(length(candidates)) C = pick(candidates) else if(owner.client) C = owner.client diff --git a/code/modules/mob/living/carbon/carbon_life.dm b/code/modules/mob/living/carbon/carbon_life.dm index 3310c5211dc..ea63a7763df 100644 --- a/code/modules/mob/living/carbon/carbon_life.dm +++ b/code/modules/mob/living/carbon/carbon_life.dm @@ -355,7 +355,7 @@ clear_fullscreen("brute") /mob/living/carbon/proc/handle_patches() - var/multiple_patch_multiplier = processing_patches.len > 1 ? (processing_patches.len * 1.5) : 1 + var/multiple_patch_multiplier = length(processing_patches) > 1 ? (length(processing_patches) * 1.5) : 1 var/applied_amount = 0.35 * multiple_patch_multiplier for(var/patch in processing_patches) diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index f6b17c19cf8..fd665b3a777 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -908,7 +908,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven if(I == handcuffed) if(istype(I, /obj/item/restraints/handcuffs/twimsts)) playsound(loc, 'sound/items/eatfood.ogg', 50, FALSE) - if(I.reagents && I.reagents.reagent_list.len) + if(I.reagents && length(I.reagents.reagent_list)) taste(I.reagents) I.reagents.reaction(src, REAGENT_INGEST) I.reagents.trans_to(src, I.reagents.total_volume) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 9f9ad50fe92..e9e304b4a4b 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -154,7 +154,7 @@ if(!H) return var/list/valid_hairstyles = generate_valid_hairstyles() - if(valid_hairstyles.len) + if(length(valid_hairstyles)) H.h_style = pick(valid_hairstyles) else //this shouldn't happen @@ -173,7 +173,7 @@ if(!H) return var/list/valid_facial_hairstyles = generate_valid_facial_hairstyles() - if(valid_facial_hairstyles.len) + if(length(valid_facial_hairstyles)) H.f_style = pick(valid_facial_hairstyles) else //this shouldn't happen @@ -185,7 +185,7 @@ if(location) valid_markings = generate_valid_markings(location) - if(valid_markings.len) + if(length(valid_markings)) m_styles[location] = pick(valid_markings) else //this shouldn't happen @@ -193,7 +193,7 @@ else for(var/m_location in list("head", "body", "tail")) valid_markings = generate_valid_markings(m_location) - if(valid_markings.len) + if(length(valid_markings)) m_styles[m_location] = pick(valid_markings) else //this shouldn't happen @@ -207,7 +207,7 @@ if(!H) return var/list/valid_head_accessories = generate_valid_head_accessories() - if(valid_head_accessories.len) + if(length(valid_head_accessories)) H.ha_style = pick(valid_head_accessories) else //this shouldn't happen @@ -350,9 +350,9 @@ var/list/valid_species = new() for(var/current_species_name in GLOB.all_species) if(check_whitelist && !check_rights(R_ADMIN, FALSE, src)) //If we're using the whitelist, make sure to check it! - if(whitelist.len && !(current_species_name in whitelist)) + if(length(whitelist) && !(current_species_name in whitelist)) continue - if(blacklist.len && (current_species_name in blacklist)) + if(length(blacklist) && (current_species_name in blacklist)) continue if(!can_use_species(src, current_species_name)) continue diff --git a/code/modules/mob/living/carbon/human/body_accessories.dm b/code/modules/mob/living/carbon/human/body_accessories.dm index 3d59dbec9be..364626c0dff 100644 --- a/code/modules/mob/living/carbon/human/body_accessories.dm +++ b/code/modules/mob/living/carbon/human/body_accessories.dm @@ -12,7 +12,7 @@ GLOBAL_LIST_EMPTY(body_accessory_by_species) GLOB.body_accessory_by_species["[species]"] = list() GLOB.body_accessory_by_species["[species]"]["[accessory.name]"] = accessory - if(GLOB.body_accessory_by_species.len) + if(length(GLOB.body_accessory_by_species)) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index cc304453716..565d09412c5 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -241,7 +241,7 @@ //It automatically updates health status /mob/living/carbon/human/heal_organ_damage(brute, burn, updating_health = TRUE) var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn) - if(!parts.len) + if(!length(parts)) return var/obj/item/organ/external/picked = pick(parts) if(picked.heal_damage(brute,burn, updating_health)) @@ -252,7 +252,7 @@ //It automatically updates health status /mob/living/carbon/human/take_organ_damage(brute, burn, updating_health = TRUE, sharp = FALSE, edge = 0) var/list/obj/item/organ/external/parts = get_damageable_organs() - if(!parts.len) + if(!length(parts)) return var/obj/item/organ/external/picked = pick(parts) if(picked.receive_damage(brute, burn, sharp, updating_health)) @@ -264,7 +264,7 @@ var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn) var/update = 0 - while(parts.len && ( brute > 0 || burn > 0)) + while(length(parts) && ( brute > 0 || burn > 0)) var/obj/item/organ/external/picked = pick(parts) var/brute_was = picked.brute_dam @@ -289,10 +289,10 @@ var/list/obj/item/organ/external/parts = get_damageable_organs() var/update = 0 - while(parts.len && (brute>0 || burn>0)) + while(length(parts) && (brute>0 || burn>0)) var/obj/item/organ/external/picked = pick(parts) - var/brute_per_part = brute/parts.len - var/burn_per_part = burn/parts.len + var/brute_per_part = brute / length(parts) + var/burn_per_part = burn / length(parts) var/brute_was = picked.brute_dam var/burn_was = picked.burn_dam diff --git a/code/modules/mob/living/carbon/human/human_examine.dm b/code/modules/mob/living/carbon/human/human_examine.dm index 165353221e9..acae13a999c 100644 --- a/code/modules/mob/living/carbon/human/human_examine.dm +++ b/code/modules/mob/living/carbon/human/human_examine.dm @@ -228,7 +228,7 @@ criminal = R.fields["criminal"] if(LAZYLEN(R.fields["comments"])) //if the commentlist is present var/list/comments = R.fields["comments"] - commentLatest = LAZYACCESS(comments, comments.len) //get the latest entry from the comment log + commentLatest = LAZYACCESS(comments, length(comments)) //get the latest entry from the comment log if(islist(commentLatest)) commentLatest = "[commentLatest["header"]]: [commentLatest["text"]]" else diff --git a/code/modules/mob/living/carbon/human/human_inventory.dm b/code/modules/mob/living/carbon/human/human_inventory.dm index 9368caf61c1..3b39a48a1f0 100644 --- a/code/modules/mob/living/carbon/human/human_inventory.dm +++ b/code/modules/mob/living/carbon/human/human_inventory.dm @@ -201,7 +201,7 @@ update_hair() //rebuild hair update_fhair() update_head_accessory() - if(hud_list.len) + if(length(hud_list)) sec_hud_set_ID() wear_mask_update(I, toggle_off = TRUE) update_inv_wear_mask() @@ -222,7 +222,7 @@ update_inv_belt() if(SLOT_HUD_WEAR_ID) wear_id = I - if(hud_list.len) + if(length(hud_list)) sec_hud_set_ID() update_inv_wear_id() if(SLOT_HUD_WEAR_PDA) diff --git a/code/modules/mob/living/carbon/human/human_life.dm b/code/modules/mob/living/carbon/human/human_life.dm index ab18b3fd2b8..b1aa99b34b0 100644 --- a/code/modules/mob/living/carbon/human/human_life.dm +++ b/code/modules/mob/living/carbon/human/human_life.dm @@ -635,7 +635,7 @@ if(healthdoll) if(stat == DEAD) healthdoll.icon_state = "healthdoll_DEAD" - if(healthdoll.overlays.len) + if(length(healthdoll.overlays)) healthdoll.overlays.Cut() else var/list/new_overlays = list() diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index c79acbd6c07..7296e27c278 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -555,7 +555,7 @@ if(setmedical != "Cancel") R.fields["p_stat"] = setmedical modified = TRUE - if(GLOB.PDA_Manifest.len) + if(length(GLOB.PDA_Manifest)) GLOB.PDA_Manifest.Cut() if(!modified) @@ -864,7 +864,7 @@ obscured |= SLOT_HUD_RIGHT_EAR obscured |= SLOT_HUD_LEFT_EAR - if(obscured.len > 0) + if(length(obscured) > 0) return obscured else return null diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 9584796cd3a..8ba0a96fcc7 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -18,7 +18,7 @@ if(!IS_HORIZONTAL(src) && world.time - l_move_time < 15) //Moving around with fractured ribs won't do you any good - if(E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15)) + if(E.is_broken() && E.internal_organs && length(E.internal_organs) && prob(15)) var/obj/item/organ/internal/I = pick(E.internal_organs) E.custom_pain("You feel broken bones moving in your [E.name]!") I.receive_damage(rand(3, 5)) diff --git a/code/modules/mob/living/carbon/human/human_say.dm b/code/modules/mob/living/carbon/human/human_say.dm index f8d56e8934d..0041ca03dbf 100644 --- a/code/modules/mob/living/carbon/human/human_say.dm +++ b/code/modules/mob/living/carbon/human/human_say.dm @@ -13,7 +13,7 @@ //These only pertain to common. Languages are handled by mob/say_understands() if(!speaking) if(isnymph(other)) - if(other.languages.len >= 2) //They've sucked down some blood and can speak common now. + if(length(other.languages) >= 2) //They've sucked down some blood and can speak common now. return 1 if(issilicon(other)) return 1 diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index f24d67e8346..9c743a9e373 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -590,7 +590,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) bloodsies.color = w_uniform.blood_color standing.overlays += bloodsies - if(w_uniform.accessories.len) //WE CHECKED THE TYPE ABOVE. THIS REALLY SHOULD BE FINE. // oh my god kys whoever made this if statement jfc :gun: + if(length(w_uniform.accessories)) //WE CHECKED THE TYPE ABOVE. THIS REALLY SHOULD BE FINE. // oh my god kys whoever made this if statement jfc :gun: for(var/obj/item/clothing/accessory/A in w_uniform:accessories) var/tie_color = A.item_color if(!tie_color) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 1d6d67f995d..483c58b8ae8 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -858,13 +858,13 @@ if(SLOT_HUD_IN_BACKPACK) if(H.back && istype(H.back, /obj/item/storage/backpack)) var/obj/item/storage/backpack/B = H.back - if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) + if(length(B.contents) < B.storage_slots && I.w_class <= B.max_w_class) return TRUE if(H.back && ismodcontrol(H.back)) var/obj/item/mod/control/C = H.back if(C.bag) var/obj/item/storage/backpack/B = C.bag - if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) + if(length(B.contents) < B.storage_slots && I.w_class <= B.max_w_class) return TRUE return FALSE if(SLOT_HUD_TIE) diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index eb8f49a4414..747eec39daa 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -53,7 +53,7 @@ // 3% chance that our golem has a human surname, because cultural contamination if(prob(human_surname_chance)) golem_surname = pick(GLOB.last_names) - else if(special_names && special_names.len && prob(special_name_chance)) + else if(special_names && length(special_names) && prob(special_name_chance)) golem_surname = pick(special_names) var/golem_name = "[prefix] [golem_surname]" @@ -448,7 +448,7 @@ if(T.y>world.maxy-tele_range || T.yworld.maxy-tele_range || T.yYou're not missing any limbs!") return diff --git a/code/modules/mob/living/carbon/superheroes.dm b/code/modules/mob/living/carbon/superheroes.dm index e3bc02451f1..b5f2f797b38 100644 --- a/code/modules/mob/living/carbon/superheroes.dm +++ b/code/modules/mob/living/carbon/superheroes.dm @@ -34,7 +34,7 @@ singlemutcheck(H, mutation, MUTCHK_FORCED) /datum/superheroes/proc/assign_spells(mob/living/carbon/human/H) - if(default_spells.len) + if(length(default_spells)) for(var/spell in default_spells) var/datum/spell/S = spell if(!S) @@ -161,7 +161,7 @@ return T /datum/spell/recruit/can_cast(mob/user = usr, charge_check = TRUE, show_message = FALSE) - if(SSticker.mode.greyshirts.len >= 3) + if(length(SSticker.mode.greyshirts) >= 3) if(show_message) to_chat(user, "You have already recruited the maximum number of henchmen.") return FALSE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 97312fe3906..406d4154a65 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1010,7 +1010,7 @@ if(client) if(new_z) SSmobs.clients_by_zlevel[new_z] += src - for(var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511 + for(var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance) var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I] if(SA) SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs diff --git a/code/modules/mob/living/living_say.dm b/code/modules/mob/living/living_say.dm index 955d72abde2..f1af846f40d 100644 --- a/code/modules/mob/living/living_say.dm +++ b/code/modules/mob/living/living_say.dm @@ -210,7 +210,7 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key) var/message_range = world.view //speaking into radios - if(used_radios.len) + if(length(used_radios)) italics = TRUE message_range = 1 if(first_piece.speaking) @@ -440,7 +440,7 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key) if(M.client) speech_bubble_recipients.Add(M.client) - if(eavesdropping.len) + if(length(eavesdropping)) stars_all(message_pieces) //hopefully passing the message twice through stars() won't hurt... I guess if you already don't understand the language, when they speak it too quietly to hear normally you would be able to catch even less. for(var/mob/M in eavesdropping) M.hear_say(message_pieces, verb, italics, src, use_voice = FALSE) @@ -449,7 +449,7 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key) speech_bubble("[bubble_icon][speech_bubble_test]", src, speech_bubble_recipients) - if(watching.len) + if(length(watching)) var/rendered = "[name] [not_heard]." for(var/mob/M in watching) M.show_message(rendered, 2) diff --git a/code/modules/mob/living/silicon/ai/ai_mob.dm b/code/modules/mob/living/silicon/ai/ai_mob.dm index f707fe927a9..89ad5bed7c4 100644 --- a/code/modules/mob/living/silicon/ai/ai_mob.dm +++ b/code/modules/mob/living/silicon/ai/ai_mob.dm @@ -155,7 +155,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( while(!pickedName) pickedName = pick(GLOB.ai_names) for(var/mob/living/silicon/ai/A in GLOB.mob_list) - if(A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop + if(A.real_name == pickedName && length(possibleNames) > 1) //fixing the theoretically possible infinite loop possibleNames -= pickedName pickedName = null @@ -273,11 +273,11 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( to_chat(src, "For department channels, use the following say commands:") var/radio_text = "" - for(var/i = 1 to aiRadio.channels.len) + for(var/i = 1 to length(aiRadio.channels)) var/channel = aiRadio.channels[i] var/key = get_radio_key_from_channel(channel) radio_text += "[key] - [channel]" - if(i != aiRadio.channels.len) + if(i != length(aiRadio.channels)) radio_text += ", " to_chat(src, radio_text) @@ -324,10 +324,10 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( dat += "-- [area_name] ([(dat2 != "") ? dat2 : "No Camera"])" else dat += "-- [area_name] (No Camera)" - if(sources.len > 1) + if(length(sources) > 1) dat += "- [length(sources)] sources" dat += "
    \n" - if(!L.len) + if(!length(L)) dat += "-- All Systems Nominal
    \n" dat += "
    \n" @@ -883,9 +883,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( return TRUE if(O) var/obj/machinery/camera/C = locateUID(O[1]) - if(O.len == 1 && !QDELETED(C) && C.can_use()) + if(length(O) == 1 && !QDELETED(C) && C.can_use()) queueAlarm("--- [class] alarm detected in [A.name]! ([C.c_tag])", class) - else if(O && O.len) + else if(O && length(O)) var/foo = 0 var/dat2 = "" for(var/thing in O) @@ -951,7 +951,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( continue var/list/tempnetwork = difflist(C.network,GLOB.restricted_camera_networks,1) - if(tempnetwork.len) + if(length(tempnetwork)) for(var/i in tempnetwork) cameralist[i] = i var/old_network = network @@ -1034,7 +1034,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( for(var/datum/data/record/t in GLOB.data_core.general)//Look in data core general. personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["photo"]//Pull names, rank, and id photo. - if(personnel_list.len) + if(length(personnel_list)) input = tgui_input_list(usr, "Select a crew member", "Change Hologram", personnel_list) var/icon/character_icon = personnel_list[input] if(character_icon) diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 495f8d9372f..bb69a2e2cef 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -63,7 +63,7 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores) // Before calling this, make sure an empty core exists, or this will no-op /mob/living/silicon/ai/proc/moveToEmptyCore() - if(!GLOB.empty_playable_ai_cores.len) + if(!length(GLOB.empty_playable_ai_cores)) CRASH("moveToEmptyCore called without any available cores") // IsJobAvailable for AI checks that there is an empty core available in this list diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index e19be02507f..09e6f0a9abe 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -107,10 +107,10 @@ gripped_item?.afterattack(target, user, 1, params) //If gripped_item either didn't get deleted, or it failed to be transfered to its target - if(!gripped_item && contents.len) + if(!gripped_item && length(contents)) gripped_item = contents[1] return FALSE - else if(gripped_item && !contents.len) + else if(gripped_item && !length(contents)) gripped_item = null else if(isitem(target)) //Check that we're not pocketing a mob. diff --git a/code/modules/mob/living/silicon/robot/robot_mob.dm b/code/modules/mob/living/silicon/robot/robot_mob.dm index 2891de7530b..959c3e8a6ab 100644 --- a/code/modules/mob/living/silicon/robot/robot_mob.dm +++ b/code/modules/mob/living/silicon/robot/robot_mob.dm @@ -742,7 +742,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( dat += "" dat += "-- [area_name]" dat += "
    \n" - if(!L.len) + if(!length(L)) dat += "-- All Systems Nominal
    \n" dat += "
    \n" diff --git a/code/modules/mob/living/silicon/silicon_mob.dm b/code/modules/mob/living/silicon/silicon_mob.dm index 9a374ea0f88..a487def354f 100644 --- a/code/modules/mob/living/silicon/silicon_mob.dm +++ b/code/modules/mob/living/silicon/silicon_mob.dm @@ -133,7 +133,7 @@ return /mob/living/silicon/proc/queueAlarm(message, type, incoming = TRUE) - var/in_cooldown = (alarms_to_show.len > 0 || alarms_to_clear.len > 0) + var/in_cooldown = (length(alarms_to_show) > 0 || length(alarms_to_clear) > 0) if(incoming) alarms_to_show += message alarm_types_show[type] += 1 @@ -147,7 +147,7 @@ addtimer(CALLBACK(src, PROC_REF(show_alarms)), 3 SECONDS) /mob/living/silicon/proc/show_alarms() - if(alarms_to_show.len < 5) + if(length(alarms_to_show) < 5) for(var/msg in alarms_to_show) to_chat(src, msg) else if(length(alarms_to_show)) @@ -173,11 +173,11 @@ var/msg_text = msg.Join("") to_chat(src, msg_text) - if(alarms_to_clear.len < 3) + if(length(alarms_to_clear) < 3) for(var/msg in alarms_to_clear) to_chat(src, msg) - else if(alarms_to_clear.len) + else if(length(alarms_to_clear)) var/list/msg = list("--- ") if(alarm_types_clear["Motion"]) diff --git a/code/modules/mob/living/simple_animal/bot/bot_construction.dm b/code/modules/mob/living/simple_animal/bot/bot_construction.dm index 875fc6e1a45..79cd8ab61e7 100644 --- a/code/modules/mob/living/simple_animal/bot/bot_construction.dm +++ b/code/modules/mob/living/simple_animal/bot/bot_construction.dm @@ -254,7 +254,7 @@ return if(!istype(src, /obj/item/storage/toolbox)) return - if(contents.len >= 1) + if(length(contents) >= 1) to_chat(user, "They won't fit in, as there is already stuff inside.") return if(T.use(10)) @@ -332,7 +332,7 @@ robot_arm = I.type //Making a medibot! - if(contents.len) + if(length(contents)) to_chat(user, "You need to empty [src] out first!") return @@ -618,7 +618,7 @@ else robot_arm = W.type - if(contents.len) + if(length(contents)) to_chat(user, "You need to empty [src] out first!") return diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 9b7c3e74d4c..b96a046710e 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -482,7 +482,7 @@ if(C.stat==2) continue targets += C - if(targets.len) + if(length(targets)) if(prob(50)) var/mob/toshoot = pick(targets) if(toshoot) @@ -496,7 +496,7 @@ else shootAt(toshoot) else if(prob(50)) - if(targets.len) + if(length(targets)) var/mob/toarrest = pick(targets) if(toarrest) target = toarrest diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 221ca0d017d..8db8e6c708d 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -672,7 +672,7 @@ var/obj/effect/decal/cleanable/blood/tracks/B = locate() in next if(!B) B = new /obj/effect/decal/cleanable/blood/tracks(loc) - if(blood_DNA && blood_DNA.len) + if(blood_DNA && length(blood_DNA)) B.blood_DNA |= blood_DNA.Copy() B.basecolor = currentBloodColor var/newdir = get_dir(next, loc) diff --git a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm index ff76eef3957..635fbbbc7f1 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm @@ -173,7 +173,7 @@ if(stat != CONSCIOUS) return FALSE - if(donors.len < evolve_donors) + if(length(donors) < evolve_donors) to_chat(src, "You need more blood in order to ascend to a new state of consciousness...") return FALSE @@ -259,12 +259,12 @@ update_progression() /mob/living/simple_animal/diona/proc/update_progression() - if(stat != CONSCIOUS || !donors.len) + if(stat != CONSCIOUS || !length(donors)) return FALSE - if(donors.len == evolve_donors) + if(length(donors) == evolve_donors) to_chat(src, "You feel ready to move on to your next stage of growth.") - else if(donors.len == awareness_donors) + else if(length(donors) == awareness_donors) universal_understand = TRUE to_chat(src, "You feel your awareness expand, and realize you know how to understand the creatures around you.") else diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 089dacb4750..c7479382f93 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -43,10 +43,10 @@ /mob/living/simple_animal/hostile/retaliate/goat/handle_automated_movement() . = ..() //chance to go crazy and start wacking stuff - if(!enemies.len && prob(1)) + if(!length(enemies) && prob(1)) Retaliate() - if(enemies.len && prob(10)) + if(length(enemies) && prob(10)) enemies = list() LoseTarget() visible_message("[src] calms down.") diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index e501bf3d528..5d05c17c5eb 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -236,7 +236,7 @@ target = beehome if(!beehome) //add ourselves to a beebox (of the same reagent) if we have no home for(var/obj/structure/beebox/BB in view(vision_range, src)) - if(reagent_incompatible(BB.queen_bee) || BB.bees.len >= BB.get_max_bees()) + if(reagent_incompatible(BB.queen_bee) || length(BB.bees) >= BB.get_max_bees()) continue BB.bees |= src beehome = BB diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index 45e18dfd550..11c9de2d711 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -151,7 +151,7 @@ /mob/living/simple_animal/hostile/floor_cluwne/proc/Acquire_Victim(specific) var/list/players_copy = GLOB.player_list.Copy() - while(players_copy.len) + while(length(players_copy)) var/mob/living/carbon/human/H = pick_n_take(players_copy) if(!ishuman(H)) continue diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index db9ea7ed9d0..0d104ab1d01 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -179,7 +179,7 @@ var/possible_target_distance = get_dist(targets_from, A) if(target_dist < possible_target_distance) Targets -= A - if(!Targets.len)//We didnt find nothin! + if(!length(Targets))//We didnt find nothin! return var/chosen_target = pick(Targets)//Pick the remaining targets (if any) at random return chosen_target @@ -333,7 +333,7 @@ /mob/living/simple_animal/hostile/proc/Aggro() vision_range = aggro_vision_range - if(target && emote_taunt.len && prob(taunt_chance)) + if(target && length(emote_taunt) && prob(taunt_chance)) custom_emote(EMOTE_VISIBLE, "[pick(emote_taunt)] at [target].") taunt_chance = max(taunt_chance-7,2) @@ -537,7 +537,7 @@ if(!T) return - if(!length(SSmobs.clients_by_zlevel[T.z])) // It's fine to use .len here but doesn't compile on 511 + if(!length(SSmobs.clients_by_zlevel[T.z])) toggle_ai(AI_Z_OFF) return diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 5483c9390c9..94af1932245 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -254,12 +254,12 @@ Difficulty: Hard . = list() for(var/mob/living/L in targets) var/list/bloodpool = get_pools(get_turf(L), 0) - if(bloodpool.len && (!faction_check_mob(L) || L.stat == DEAD)) + if(length(bloodpool) && (!faction_check_mob(L) || L.stat == DEAD)) . += L /mob/living/simple_animal/hostile/megafauna/bubblegum/proc/try_bloodattack() var/list/targets = get_mobs_on_blood() - if(targets.len) + if(length(targets)) INVOKE_ASYNC(src, PROC_REF(bloodattack), targets, prob(enraged ? 75 : 50)) return TRUE return FALSE @@ -268,7 +268,7 @@ Difficulty: Hard var/mob/living/target_one = pick_n_take(targets) var/turf/target_one_turf = get_turf(target_one) var/mob/living/target_two - if(targets.len) + if(length(targets)) target_two = pick_n_take(targets) var/turf/target_two_turf = get_turf(target_two) if(target_two.stat != CONSCIOUS || prob(10)) @@ -278,7 +278,7 @@ Difficulty: Hard if(target_one) var/list/pools = get_pools(get_turf(target_one), 0) - if(pools.len) + if(length(pools)) target_one_turf = get_turf(target_one) if(target_one_turf) if(target_one.stat != CONSCIOUS || prob(10)) @@ -288,7 +288,7 @@ Difficulty: Hard if(!target_two && target_one) var/list/poolstwo = get_pools(get_turf(target_one), 0) - if(poolstwo.len) + if(length(poolstwo)) target_one_turf = get_turf(target_one) if(target_one_turf) if(target_one.stat != CONSCIOUS || prob(10)) @@ -333,13 +333,13 @@ Difficulty: Hard if(Adjacent(target)) return FALSE var/list/can_jaunt = get_pools(get_turf(src), 1) - if(!can_jaunt.len) + if(!length(can_jaunt)) return FALSE var/list/pools = get_pools(get_turf(target), 5) var/list/pools_to_remove = get_pools(get_turf(target), 4) pools -= pools_to_remove - if(!pools.len) + if(!length(pools)) return FALSE var/obj/effect/temp_visual/decoy/DA = new /obj/effect/temp_visual/decoy(loc,src) @@ -357,7 +357,7 @@ Difficulty: Hard pools = get_pools(get_turf(target), 5) pools_to_remove = get_pools(get_turf(target), 4) pools -= pools_to_remove - if(pools.len) + if(length(pools)) shuffle_inplace(pools) found_bloodpool = pick(pools) if(found_bloodpool) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 2ef2491296e..7e98435c073 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -175,7 +175,7 @@ Difficulty: Hard possibilities = list("chaser_swarm") else possibilities += "chaser_swarm" - if(possibilities.len) + if(length(possibilities)) switch(pick(possibilities)) if("blink_spam") //blink either once or multiple times. blink_spam(blink_counter, target_slowness, cross_counter) @@ -277,9 +277,9 @@ Difficulty: Hard SLEEP_CHECK_DEATH(6) var/list/targets = ListTargets() var/list/cardinal_copy = GLOB.cardinal.Copy() - while(targets.len && cardinal_copy.len) + while(length(targets) && length(cardinal_copy)) var/mob/living/pickedtarget = pick(targets) - if(targets.len >= cardinal_copy.len) + if(length(targets) >= length(cardinal_copy)) pickedtarget = pick_n_take(targets) if(!istype(pickedtarget) || pickedtarget.stat == DEAD) pickedtarget = target diff --git a/code/modules/mob/living/simple_animal/hostile/mimic_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mimic_mobs.dm index 0e6ef877eb8..33356c1d36d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic_mobs.dm @@ -315,11 +315,11 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca visible_message("The [src] clears a jam!") Pewgun.chambered.loc = loc //rip revolver immersions, blame shotgun snowflake procs Pewgun.chambered = null - if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len) + if(Pewgun.magazine && length(Pewgun.magazine.stored_ammo)) Pewgun.chambered = Pewgun.magazine.get_round(0) Pewgun.chambered.loc = Pewgun Pewgun.update_icon() - else if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len) //only true for pumpguns i think + else if(Pewgun.magazine && length(Pewgun.magazine.stored_ammo)) //only true for pumpguns i think Pewgun.chambered = Pewgun.magazine.get_round(0) Pewgun.chambered.loc = Pewgun visible_message("The [src] cocks itself!") diff --git a/code/modules/mob/living/simple_animal/hostile/mining/goldgrub.dm b/code/modules/mob/living/simple_animal/hostile/mining/goldgrub.dm index d28b936adeb..c6021bab7c4 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/goldgrub.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/goldgrub.dm @@ -42,7 +42,7 @@ /mob/living/simple_animal/hostile/asteroid/goldgrub/GiveTarget(new_target) target = new_target if(target != null) - if(istype(target, /obj/item/stack/ore) && loot.len < 10) + if(istype(target, /obj/item/stack/ore) && length(loot) < 10) visible_message("[src] looks at [target.name] with hungry eyes.") else if(isliving(target)) Aggro() diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm index bbc45c0b7fd..2cd5dddf990 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm @@ -14,7 +14,7 @@ return A /mob/living/simple_animal/hostile/retaliate/ListTargets() - if(!enemies.len) + if(!length(enemies)) return list() var/list/see = ..() see &= enemies // Remove all entries that aren't in enemies diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm index afd4595d3bd..36ffb309a1d 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm @@ -126,7 +126,7 @@ if(!ranged) playsound(loc, 'sound/weapons/saberon.ogg', 35, 1) if(alert_on_shield_breach) - if(depotarea.shield_list.len) + if(length(depotarea.shield_list)) raise_alert("[name] reports that [target] is trying to breach the armory shield!") alert_on_shield_breach = FALSE raised_alert = FALSE @@ -282,7 +282,7 @@ var/list/key_candidates = list() for(var/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer/O in GLOB.alive_mob_list) key_candidates += O - if(key_candidates.len) + if(length(key_candidates)) var/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer/O = pick(key_candidates) O.shield_key = TRUE depotarea.shields_up() diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm index b406f470d33..8cf7af301e1 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm @@ -111,7 +111,7 @@ if(temp_vent.welded) // no point considering a vent we can't even use continue 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) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm index 07276a401f4..5134355baf4 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm @@ -68,9 +68,9 @@ targets2 += M else targets3 += M - if(targets1.len) + if(length(targets1)) return targets1 - if(targets2.len) + if(length(targets2)) return targets2 return targets3 @@ -275,7 +275,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) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm index 81d166eedab..35a3ad73b20 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm @@ -377,7 +377,7 @@ GLOBAL_LIST_EMPTY(ts_infected_list) to_chat(T, "TerrorSense: [msgtext]") /mob/living/simple_animal/hostile/poison/terror_spider/proc/CheckFaction() - if(faction.len != 2 || (!("terrorspiders" in faction)) || master_commander != null) + if(length(faction) != 2 || (!("terrorspiders" in faction)) || master_commander != null) to_chat(src, "Your connection to the hive mind has been severed!") stack_trace("Terror spider with incorrect faction list at: [atom_loc_line(src)]") gib() diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index a6a840906f8..84ee41256fc 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -90,7 +90,7 @@ step(L,get_dir(L,src)) //reel them in L.Weaken(6 SECONDS) //you can't get away now~ - if(grasping.len < max_grasps) + if(length(grasping) < max_grasps) grasping: for(var/mob/living/L in view(grasp_range, src)) if(L == src || faction_check_mob(L) || (L in grasping) || L == target) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 21552a5898b..591053c3b11 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -249,8 +249,8 @@ Phrases that the parrot hears in mob/living/say() get added to speach_buffer. Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list. Then it clears the buffer to make sure they dont magically remember something from hours ago. */ - if(speech_buffer.len && prob(10)) - if(clean_speak.len) + if(length(speech_buffer) && prob(10)) + if(length(clean_speak)) clean_speak -= pick(clean_speak) clean_speak += pick(speech_buffer) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 06020517b73..f2ff761520e 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -258,33 +258,33 @@ set waitfor = FALSE if(speak_chance) if(prob(speak_chance) || override) - if(speak && speak.len) - if((emote_hear && emote_hear.len) || (emote_see && emote_see.len)) - var/length = speak.len - if(emote_hear && emote_hear.len) - length += emote_hear.len - if(emote_see && emote_see.len) - length += emote_see.len + if(speak && length(speak)) + if((emote_hear && length(emote_hear)) || (emote_see && length(emote_see))) + var/length = length(speak) + if(emote_hear && length(emote_hear)) + length += length(emote_hear) + if(emote_see && length(emote_see)) + length += length(emote_see) var/randomValue = rand(1,length) - if(randomValue <= speak.len) + if(randomValue <= length(speak)) say(pick(speak)) else - randomValue -= speak.len - if(emote_see && randomValue <= emote_see.len) + randomValue -= length(speak) + if(emote_see && randomValue <= length(emote_see)) custom_emote(EMOTE_VISIBLE, pick(emote_see)) else custom_emote(EMOTE_AUDIBLE, pick(emote_hear)) else say(pick(speak)) else - if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len)) + if(!(emote_hear && length(emote_hear)) && (emote_see && length(emote_see))) custom_emote(EMOTE_VISIBLE, pick(emote_see)) - if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len)) + if((emote_hear && length(emote_hear)) && !(emote_see && length(emote_see))) custom_emote(EMOTE_AUDIBLE, pick(emote_hear)) - if((emote_hear && emote_hear.len) && (emote_see && emote_see.len)) - var/length = emote_hear.len + emote_see.len + if((emote_hear && length(emote_hear)) && (emote_see && length(emote_see))) + var/length = length(emote_hear) + length(emote_see) var/pick = rand(1,length) - if(pick <= emote_see.len) + if(pick <= length(emote_see)) custom_emote(EMOTE_VISIBLE, pick(emote_see)) else custom_emote(EMOTE_AUDIBLE, pick(emote_hear)) @@ -361,7 +361,7 @@ /mob/living/simple_animal/say_quote(message) var/verb = "says" - if(speak_emote.len) + if(length(speak_emote)) verb = pick(speak_emote) return verb diff --git a/code/modules/mob/living/simple_animal/slime/slime_life.dm b/code/modules/mob/living/simple_animal/slime/slime_life.dm index 67d15345bea..b15e5cefeb6 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_life.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_life.dm @@ -9,7 +9,7 @@ handle_nutrition() if(QDELETED(src)) // Stop if the slime split during handle_nutrition() return - reagents.remove_all(0.5 * REAGENTS_METABOLISM * reagents.reagent_list.len) //Slimes are such snowflakes + reagents.remove_all(0.5 * REAGENTS_METABOLISM * length(reagents.reagent_list)) //Slimes are such snowflakes handle_targets() if(!ckey) handle_mood() @@ -319,7 +319,7 @@ targets += L // Possible target found! - if(targets.len > 0) + if(length(targets) > 0) if(attacked || rabid || hungry == 2) Target = targets[1] // I am attacked and am fighting back or so hungry I don't even care else diff --git a/code/modules/mob/living/simple_animal/slime/slime_mob.dm b/code/modules/mob/living/simple_animal/slime/slime_mob.dm index 2e4fca91f6f..20282318580 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_mob.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_mob.dm @@ -337,7 +337,7 @@ discipline_slime(M) else - if(stat == DEAD && surgeries.len) + if(stat == DEAD && length(surgeries)) if(M.a_intent == INTENT_HELP || M.a_intent == INTENT_DISARM) for(var/datum/surgery/S in surgeries) if(S.next_step(M, src)) @@ -353,7 +353,7 @@ /mob/living/simple_animal/slime/attackby(obj/item/I, mob/living/user, params) - if(stat == DEAD && surgeries.len) + if(stat == DEAD && length(surgeries)) if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM) for(var/datum/surgery/S in surgeries) if(S.next_step(user, src)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 36958d7be1e..cd74386bdd7 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -523,7 +523,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(SLOT_HUD_IN_BACKPACK) if(H.back && istype(H.back, /obj/item/storage/backpack)) var/obj/item/storage/backpack/B = H.back - if(B.contents.len < B.storage_slots && w_class <= B.max_w_class) + if(length(B.contents) < B.storage_slots && w_class <= B.max_w_class) return 1 return 0 return 0 //Unsupported slot @@ -1221,8 +1221,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ //That makes the logs easier to read, but because all of this is stored in strings, weird things have to be used to get it all out. var/new_log = "\[[time_stamp()]] [text]" - if(target.len)//if there are other logs already present - var/previous_log = target[target.len]//get the latest log + if(length(target))//if there are other logs already present + var/previous_log = target[length(target)]//get the latest log var/last_log_is_range = (copytext(previous_log, 10, 11) == "-") //whether the last log is a time range or not. The "-" will be an indicator that it is. var/x_sign_position = findtext(previous_log, "x") @@ -1247,7 +1247,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ rep = text2num(copytext(previous_log, 44, x_sign_position))//get whatever number is right before the 'x' new_log = "\[[old_timestamp]-[time_stamp()]][rep?rep+1:2]x [text]" - target -= target[target.len]//remove the last log + target -= target[length(target)]//remove the last log target += new_log diff --git a/code/modules/mob/mob_holder.dm b/code/modules/mob/mob_holder.dm index 127563083b5..47366ef8b49 100644 --- a/code/modules/mob/mob_holder.dm +++ b/code/modules/mob/mob_holder.dm @@ -15,7 +15,7 @@ /obj/item/holder/process() - if(isturf(loc) || !(contents.len)) + if(isturf(loc) || !(length(contents))) for(var/mob/M in contents) diff --git a/code/modules/mob/mob_login_base.dm b/code/modules/mob/mob_login_base.dm index bae72a943d3..238057a92cd 100644 --- a/code/modules/mob/mob_login_base.dm +++ b/code/modules/mob/mob_login_base.dm @@ -74,7 +74,7 @@ add_click_catcher() - if(viewing_alternate_appearances && viewing_alternate_appearances.len) + if(viewing_alternate_appearances && length(viewing_alternate_appearances)) for(var/datum/alternate_appearance/AA in viewing_alternate_appearances) AA.display_to(list(src)) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 7016ca01e57..f7f5e5a38c8 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -197,7 +197,7 @@ ///Called by client/Move() ///Checks to see if you are being grabbed and if so attemps to break it /client/proc/Process_Grab() - if(mob.grabbed_by.len) + if(length(mob.grabbed_by)) if(mob.incapacitated(FALSE, TRUE)) // Can't break out of grabs if you're incapacitated return TRUE if(HAS_TRAIT(mob, TRAIT_IMMOBILIZED)) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 195daa1a173..f1b21c4e32d 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -389,7 +389,7 @@ for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list) if(A.announce_arrivals) ailist += A - if(ailist.len) + if(length(ailist)) var/mob/living/silicon/ai/announcer = pick(ailist) if(character.mind) if((character.mind.assigned_role != "Cyborg") && (character.mind.assigned_role != character.mind.special_role)) @@ -421,7 +421,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) if(character.mind) if(character.mind.assigned_role != character.mind.special_role) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index d97c3d11315..556208bbc3f 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -31,7 +31,7 @@ /obj/item/folder/update_overlays() . = ..() - if(contents.len) + if(length(contents)) . += "folder_paper" /obj/item/folder/attackby(obj/item/W as obj, mob/user as mob, params) diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 132a0888755..eef2ba38905 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -69,8 +69,8 @@ update_icon() var/obj/item/paper/P - if(papers.len > 0) //If there's any custom paper on the stack, use that instead of creating a new paper. - P = papers[papers.len] + if(length(papers) > 0) //If there's any custom paper on the stack, use that instead of creating a new paper. + P = papers[length(papers)] papers.Remove(P) else if(letterhead_type && alert("Choose a style", null,"Letterhead","Blank")=="Letterhead") @@ -133,8 +133,8 @@ update_icon() var/obj/item/paper/carbon/P - if(papers.len > 0) //If there's any custom paper on the stack, use that instead of creating a new paper. - P = papers[papers.len] + if(length(papers) > 0) //If there's any custom paper on the stack, use that instead of creating a new paper. + P = papers[length(papers)] papers.Remove(P) else P = new /obj/item/paper/carbon diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 855fdf38103..a13b8c3d12d 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -87,8 +87,8 @@ c.offset_y = copy.offset_y var/list/temp_overlays = copy.stamp_overlays //Iterates through stamps var/image/img //and puts a matching - for(var/j = 1, j <= temp_overlays.len, j++) //gray overlay onto the copy - if(copy.ico.len) + for(var/j = 1, j <= length(temp_overlays), j++) //gray overlay onto the copy + if(length(copy.ico)) if(findtext(copy.ico[j], "cap") || findtext(copy.ico[j], "cent") || findtext(copy.ico[j], "rep")) img = image('icons/obj/bureaucracy.dmi', "paper_stamp-circle") else if(findtext(copy.ico[j], "deny")) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index c3cc150362a..77ea69bf8ca 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -285,7 +285,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor continue else//not invisable, not a spookyghost add it. var/disguised = null - if(user.viewing_alternate_appearances && user.viewing_alternate_appearances.len && ishuman(A) && A.alternate_appearances && A.alternate_appearances.len) //This whole thing and the stuff below just checks if the atom is a Solid Snake cosplayer. + if(user.viewing_alternate_appearances && length(user.viewing_alternate_appearances) && ishuman(A) && A.alternate_appearances && length(A.alternate_appearances)) //This whole thing and the stuff below just checks if the atom is a Solid Snake cosplayer. for(var/datum/alternate_appearance/alt_appearance in user.viewing_alternate_appearances) if(alt_appearance.owner == A) //If it turns out they are, don't blow their cover. That'd be rude. atoms.Add(image(alt_appearance.img, A.loc, layer = 4, dir = A.dir)) //Render their disguise. @@ -299,7 +299,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor // Sort the atoms into their layers var/list/sorted = sort_atoms_by_layer(atoms) var/center_offset = (size-1)/2 * 32 + 1 - for(var/i; i <= sorted.len; i++) + for(var/i; i <= length(sorted); i++) var/atom/A = sorted[i] if(A) var/icon/img = getFlatIcon(A)//build_composite_icon(A) @@ -508,7 +508,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor addtimer(CALLBACK(src, PROC_REF(reset_cooldown)), 6.4 SECONDS) // magic numbers here too /obj/item/camera/digital/captureimage(atom/target, mob/user, flag) - if(saved_pictures.len >= max_storage) + if(length(saved_pictures) >= max_storage) to_chat(user, "Maximum photo storage capacity reached.") return to_chat(user, "Picture saved.") @@ -664,7 +664,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor /obj/item/camera/proc/sort_atoms_by_layer(list/atoms) // Comb sort icons based on levels var/list/result = atoms.Copy() - var/gap = result.len + var/gap = length(result) var/swapped = 1 while(gap > 1 || swapped) swapped = 0 @@ -672,7 +672,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor gap = round(gap / 1.3) // 1.3 is the emperic comb sort coefficient if(gap < 1) gap = 1 - for(var/i = 1; gap + i <= result.len; i++) + for(var/i = 1; gap + i <= length(result); i++) var/atom/l = result[i] //Fucking hate var/atom/r = result[gap+i] //how lists work here if(l.layer > r.layer) //no "result[i].layer" for me diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index aba7263615e..8b40a6b1df0 100644 --- a/code/modules/paperwork/silicon_photography.dm +++ b/code/modules/paperwork/silicon_photography.dm @@ -45,7 +45,7 @@ var/list/nametemp = list() var/find - if(cam.aipictures.len == 0) + if(length(cam.aipictures) == 0) to_chat(usr, "No images saved") return for(var/datum/picture/t in cam.aipictures) diff --git a/code/modules/pda/app.dm b/code/modules/pda/app.dm index cb4c4e19213..9e5a26f0ff5 100644 --- a/code/modules/pda/app.dm +++ b/code/modules/pda/app.dm @@ -46,7 +46,7 @@ /datum/data/pda/proc/unnotify() if(src in pda.notifying_programs) pda.notifying_programs -= src - if(!pda.notifying_programs.len) + if(!length(pda.notifying_programs)) pda.update_icon(UPDATE_OVERLAYS) // An app has a button on the home screen and its own UI diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm index f34c992d99b..2dd57fe8d5a 100644 --- a/code/modules/pda/cart_apps.dm +++ b/code/modules/pda/cart_apps.dm @@ -313,7 +313,7 @@ var/area/our_area = get_area(B) mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = our_area.name, "uid" = "[B.UID()]") - if(!mulebotsData.len) + if(!length(mulebotsData)) mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null) muleData["bots"] = mulebotsData @@ -378,7 +378,7 @@ supplyOrderCount++ supplyOrderData[++supplyOrderData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "ApprovedBy" = SO.orderedby, "Comment" = html_encode(SO.comment)) - if(!supplyOrderData.len) + if(!length(supplyOrderData)) supplyOrderData[++supplyOrderData.len] = list("Number" = null, "Name" = null, "OrderedBy"=null) supplyData["approved"] = supplyOrderData @@ -391,7 +391,7 @@ requestCount++ requestData[++requestData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "OrderedBy" = SO.orderedby, "Comment" = html_encode(SO.comment)) - if(!requestData.len) + if(!length(requestData)) requestData[++requestData.len] = list("Number" = null, "Name" = null, "orderedBy" = null, "Comment" = null) supplyData["requests"] = requestData @@ -460,10 +460,10 @@ var/direction_from_user = get_dir(pda, janicart) JaniCartData[++JaniCartData.len] = list("x" = janicart_loc.x, "y" = janicart_loc.y, "direction_from_user" = uppertext(dir2text(direction_from_user))) - JaniData["mops"] = MopData.len ? MopData : null - JaniData["buckets"] = BucketData.len ? BucketData : null - JaniData["cleanbots"] = CbotData.len ? CbotData : null - JaniData["carts"] = CartData.len ? CartData : null - JaniData["janicarts"] = JaniCartData.len ? JaniCartData : null + JaniData["mops"] = length(MopData) ? MopData : null + JaniData["buckets"] = length(BucketData) ? BucketData : null + JaniData["cleanbots"] = length(CbotData) ? CbotData : null + JaniData["carts"] = length(CartData) ? CartData : null + JaniData["janicarts"] = length(JaniCartData) ? JaniCartData : null data["janitor"] = JaniData diff --git a/code/modules/pda/mob_hunt_game_app.dm b/code/modules/pda/mob_hunt_game_app.dm index 7ac6efca355..73eab8cf1a5 100644 --- a/code/modules/pda/mob_hunt_game_app.dm +++ b/code/modules/pda/mob_hunt_game_app.dm @@ -96,16 +96,16 @@ data["connected"] = 1 data["wild_captures"] = wild_captures data["no_collection"] = 0 - if(!my_collection.len) + if(!length(my_collection)) data["no_collection"] = 1 return var/datum/mob_hunt/mob_info if(!current_index) current_index = 1 - if(current_index > my_collection.len) + if(current_index > length(my_collection)) current_index = 1 if(current_index < 1) - current_index = my_collection.len + current_index = length(my_collection) mob_info = my_collection[current_index] var/list/entry = list( "nickname" = mob_info.nickname, @@ -121,7 +121,7 @@ data["entry"] = entry /datum/data/pda/app/mob_hunter_game/proc/assign_nickname() - if(!my_collection.len) + if(!length(my_collection)) return var/datum/mob_hunt/mob_info = my_collection[current_index] var/old_name = mob_info.mob_name @@ -130,13 +130,13 @@ mob_info.nickname = tgui_input_text(usr, "Give a nickname to [old_name]?", "Nickname", old_name) /datum/data/pda/app/mob_hunter_game/proc/release() - if(!my_collection.len) + if(!length(my_collection)) return if(tgui_alert(usr, "Are you sure you want to release this mob back into the wild?", "Confirm Release", list("Yes", "No")) == "Yes") remove_mob() /datum/data/pda/app/mob_hunter_game/proc/print_card() - if(!pda || !my_collection.len) + if(!pda || !length(my_collection)) return var/obj/item/nanomob_card/card = new/obj/item/nanomob_card(null) var/datum/mob_hunt/mob_info = my_collection[current_index] @@ -168,7 +168,7 @@ current_index = collection_length /datum/data/pda/app/mob_hunter_game/proc/set_trap() - if(!my_collection.len || !pda || !hacked) + if(!length(my_collection) || !pda || !hacked) return var/datum/mob_hunt/bait = my_collection[current_index] bait = bait.type @@ -189,12 +189,12 @@ release() if("Next") current_index++ - if(current_index > my_collection.len) + if(current_index > length(my_collection)) current_index = 1 if("Prev") current_index-- if(current_index < 1) - current_index = my_collection.len + current_index = length(my_collection) if("Reconnect") reconnect() if("Disconnect") diff --git a/code/modules/pda/utilities.dm b/code/modules/pda/utilities.dm index 8642d0782df..37ac90e1159 100644 --- a/code/modules/pda/utilities.dm +++ b/code/modules/pda/utilities.dm @@ -107,8 +107,8 @@ /datum/data/pda/utility/scanmode/reagent/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob) var/list/messages = list() if(!isnull(A.reagents)) - if(A.reagents.reagent_list.len > 0) - var/reagents_length = A.reagents.reagent_list.len + if(length(A.reagents.reagent_list) > 0) + var/reagents_length = length(A.reagents.reagent_list) messages.Add("[reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found.") for(var/datum/reagent/R in A.reagents.reagent_list) if(R.id != "blood") diff --git a/code/modules/power/engines/singularity/field_generator.dm b/code/modules/power/engines/singularity/field_generator.dm index cc75a1e7378..5e27ef46dc6 100644 --- a/code/modules/power/engines/singularity/field_generator.dm +++ b/code/modules/power/engines/singularity/field_generator.dm @@ -45,7 +45,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields) . = ..() if(warming_up) . += "+a[warming_up]" - if(fields.len) + if(length(fields)) . += "+on" if(power_level) . += "+p[power_level]" @@ -182,7 +182,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields) /obj/machinery/field/generator/proc/calc_power() - var/power_draw = 2 + fields.len + var/power_draw = 2 + length(fields) if(draw_power(round(power_draw/2, 1))) check_power_level() @@ -333,11 +333,11 @@ GLOBAL_LIST_EMPTY(field_generator_fields) O.last_warning = world.time /obj/machinery/field/generator/shock_field(mob/living/user) - if(fields.len) + if(length(fields)) ..() /obj/machinery/field/generator/bump_field(atom/movable/AM as mob|obj) - if(fields.len) + if(length(fields)) ..() #undef FG_UNSECURED diff --git a/code/modules/power/generators/solar.dm b/code/modules/power/generators/solar.dm index c7f4bd613fb..8af1ed8f693 100644 --- a/code/modules/power/generators/solar.dm +++ b/code/modules/power/generators/solar.dm @@ -385,13 +385,13 @@ /obj/machinery/power/solar_control/ui_data(mob/user) var/list/data = list() data["generated"] = round(lastgen) //generated power by all connected panels - data["generated_ratio"] = data["generated"] / round(max(connected_panels.len, 1) * SSsun.solar_gen_rate) //power generation ratio. Used for the power bar + data["generated_ratio"] = data["generated"] / round(max(length(connected_panels), 1) * SSsun.solar_gen_rate) //power generation ratio. Used for the power bar data["direction"] = angle2text(cdir) //current orientation of the panels data["cdir"] = cdir //current orientation of the of the panels in degrees data["tracking_state"] = track //tracker status: TRACKER_OFF, TRACKER_TIMED, TRACKER_AUTO data["tracking_rate"] = trackrate //rotation speed of tracker in degrees/h data["rotating_direction"] = (trackrate < 0 ? "Counter clockwise" : "Clockwise") //direction of tracker - data["connected_panels"] = connected_panels.len + data["connected_panels"] = length(connected_panels) data["connected_tracker"] = (connected_tracker ? TRUE : FALSE) return data diff --git a/code/modules/power/powernets/powernet_helpers.dm b/code/modules/power/powernets/powernet_helpers.dm index 0a11352a5c3..94d1a9c5cf7 100644 --- a/code/modules/power/powernets/powernet_helpers.dm +++ b/code/modules/power/powernets/powernet_helpers.dm @@ -40,7 +40,7 @@ return //We assume net1 is larger. If net2 is in fact larger we are just going to make them switch places to reduce on code. - if(net1.cables.len < net2.cables.len) //net2 is larger than net1. Let's switch them around + if(length(net1.cables) < length(net2.cables)) //net2 is larger than net1. Let's switch them around var/temp = net1 net1 = net2 net2 = temp diff --git a/code/modules/procedural_mapping/mapGenerator.dm b/code/modules/procedural_mapping/mapGenerator.dm index ecb9698fee1..5d3d2af498c 100644 --- a/code/modules/procedural_mapping/mapGenerator.dm +++ b/code/modules/procedural_mapping/mapGenerator.dm @@ -83,7 +83,7 @@ //Requests the mapGeneratorModule(s) to (re)generate /datum/mapGenerator/proc/generate() syncModules() - if(!modules || !modules.len) + if(!modules || !length(modules)) return for(var/datum/mapGeneratorModule/mod in modules) spawn(0) @@ -95,7 +95,7 @@ if(!T) return syncModules() - if(!modules || !modules.len) + if(!modules || !length(modules)) return for(var/datum/mapGeneratorModule/mod in modules) spawn(0) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 6b52313e991..0e33fbc6ef4 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -210,7 +210,7 @@ /obj/item/gun/proc/can_trigger_gun(mob/living/user) if(!user.can_use_guns(src)) return 0 - if(restricted_species && restricted_species.len && !is_type_in_list(user.dna.species, restricted_species)) + if(restricted_species && length(restricted_species) && !is_type_in_list(user.dna.species, restricted_species)) to_chat(user, "[src] is incompatible with your biology!") return 0 return 1 diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 9502b94bdb3..9bc6e43ec82 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -46,7 +46,7 @@ . = TRUE if(!max_mod_capacity) return - if(!modkits.len) + if(!length(modkits)) to_chat(user, "There are no modifications currently installed.") return if(!I.use_tool(src, user, 0, volume = I.tool_volume)) diff --git a/code/modules/projectiles/guns/energy_guns.dm b/code/modules/projectiles/guns/energy_guns.dm index eea499c0be2..67f2d45398c 100644 --- a/code/modules/projectiles/guns/energy_guns.dm +++ b/code/modules/projectiles/guns/energy_guns.dm @@ -61,7 +61,7 @@ /obj/item/gun/energy/proc/update_ammo_types() var/obj/item/ammo_casing/energy/shot select = clamp(select, 1, length(ammo_type)) // If we decrease ammo types while selecting a removed one, we want to make sure it doesnt try to select an out of bounds index - for(var/i = 1, i <= ammo_type.len, i++) + for(var/i = 1, i <= length(ammo_type), i++) var/shottype = ammo_type[i] shot = new shottype(src) ammo_type[i] = shot @@ -90,7 +90,7 @@ newshot() /obj/item/gun/energy/attack_self(mob/living/user as mob) - if(ammo_type.len > 1) + if(length(ammo_type) > 1) select_fire(user) update_icon() if(ishuman(user)) //This has to be here or else if you toggle modes by clicking the gun in hand @@ -127,7 +127,7 @@ /obj/item/gun/energy/proc/select_fire(mob/living/user) select++ - if(select > ammo_type.len) + if(select > length(ammo_type)) select = 1 var/obj/item/ammo_casing/energy/shot = ammo_type[select] fire_sound = shot.fire_sound diff --git a/code/modules/projectiles/guns/grenade_launcher.dm b/code/modules/projectiles/guns/grenade_launcher.dm index a2c4e3bd46d..0f581dd75d3 100644 --- a/code/modules/projectiles/guns/grenade_launcher.dm +++ b/code/modules/projectiles/guns/grenade_launcher.dm @@ -16,17 +16,17 @@ /obj/item/gun/grenadelauncher/examine(mob/user) . = ..() if(get_dist(user, src) <= 2) - . += "[grenades.len] / [max_grenades] grenades." + . += "[length(grenades)] / [max_grenades] grenades." /obj/item/gun/grenadelauncher/attackby(obj/item/I as obj, mob/user as mob, params) if((istype(I, /obj/item/grenade))) - if(grenades.len < max_grenades) + if(length(grenades) < max_grenades) if(!user.unEquip(I)) return I.loc = src grenades += I to_chat(user, "You put the grenade in [src].") - to_chat(user, "[grenades.len] / [max_grenades] grenades.") + to_chat(user, "[length(grenades)] / [max_grenades] grenades.") else to_chat(user, "The grenade launcher cannot hold more grenades.") else @@ -36,7 +36,7 @@ if(target == user) return - if(grenades.len) + if(length(grenades)) fire_grenade(target,user) else to_chat(user, "The grenade launcher is empty.") diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 5558b2ed2fd..9963f90cc99 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -357,7 +357,7 @@ return ..() /obj/item/gun/projectile/shotgun/automatic/dual_tube/attack_self(mob/living/user) - if(!chambered && magazine.contents.len) + if(!chambered && length(magazine.contents)) pump() else toggle_tube(user) diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index 8b6e5b9f907..43781e87570 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -192,7 +192,7 @@ /obj/item/ammo_box/magazine/toy/sniper_rounds/update_overlays() . = ..() var/ammo = ammo_count() - if(ammo && istype(contents[contents.len], /obj/item/ammo_casing/caseless/foam_dart/sniper/riot)) + if(ammo && istype(contents[length(contents)], /obj/item/ammo_casing/caseless/foam_dart/sniper/riot)) . += ".50mag-r" else if(ammo) . += ".50mag-f" diff --git a/code/modules/projectiles/guns/syringe_gun.dm b/code/modules/projectiles/guns/syringe_gun.dm index 390e2693f84..7c678e630ca 100644 --- a/code/modules/projectiles/guns/syringe_gun.dm +++ b/code/modules/projectiles/guns/syringe_gun.dm @@ -41,7 +41,7 @@ /obj/item/gun/syringe/examine(mob/user) . = ..() - var/num_syringes = syringes.len + (chambered.BB ? 1 : 0) + var/num_syringes = length(syringes) + (chambered.BB ? 1 : 0) . += "Can hold [max_syringes] syringe\s. Has [num_syringes] syringe\s remaining." /obj/item/gun/syringe/attack_self(mob/living/user) diff --git a/code/modules/projectiles/guns/throw.dm b/code/modules/projectiles/guns/throw.dm index 36483a237f8..0a7a246b16b 100644 --- a/code/modules/projectiles/guns/throw.dm +++ b/code/modules/projectiles/guns/throw.dm @@ -25,7 +25,7 @@ return /obj/item/gun/throw/proc/get_ammocount(include_loaded = 1) - var/count = loaded_projectiles.len + var/count = length(loaded_projectiles) if(include_loaded && to_launch) count++ return count @@ -63,7 +63,7 @@ to_chat(user, "You cannot load [I] into [src]!") /obj/item/gun/throw/process_chamber() - if(!to_launch && loaded_projectiles.len) + if(!to_launch && length(loaded_projectiles)) to_launch = loaded_projectiles[1] loaded_projectiles -= to_launch return diff --git a/code/modules/projectiles/projectile_base.dm b/code/modules/projectiles/projectile_base.dm index 6d1b57c6615..2bea14964e6 100644 --- a/code/modules/projectiles/projectile_base.dm +++ b/code/modules/projectiles/projectile_base.dm @@ -295,7 +295,7 @@ var/list/mobs_list = list() for(var/mob/living/L in target_turf) mobs_list += L - if(mobs_list.len) + if(length(mobs_list)) var/mob/living/picked_mob = pick(mobs_list) prehit(picked_mob) picked_mob.bullet_act(src, def_zone) @@ -529,7 +529,7 @@ thing.set_light(muzzle_flash_range, muzzle_flash_intensity, muzzle_flash_color_override? muzzle_flash_color_override : color) QDEL_IN(thing, duration) if(impacting && impact_type && duration > 0) - var/datum/point_precise/p = beam_segments[beam_segments[beam_segments.len]] + var/datum/point_precise/p = beam_segments[beam_segments[length(beam_segments)]] var/atom/movable/thing = new impact_type p.move_atom_to_src(thing) var/matrix/matrix = new diff --git a/code/modules/reagents/chem_splash.dm b/code/modules/reagents/chem_splash.dm index e15c57d068e..c092c049c2b 100644 --- a/code/modules/reagents/chem_splash.dm +++ b/code/modules/reagents/chem_splash.dm @@ -6,7 +6,7 @@ /proc/chem_splash(turf/epicenter, affected_range = 3, list/datum/reagents/reactants = list(), extra_heat = 0, threatscale = 1, adminlog = 1) - if(!isturf(epicenter) || !reactants.len || threatscale <= 0) + if(!isturf(epicenter) || !length(reactants) || threatscale <= 0) return var/has_reagents var/total_reagents @@ -25,7 +25,7 @@ for(var/datum/reagents/R in reactants) R.trans_to(splash_holder, R.total_volume, threatscale, 1, 1) total_temp += R.chem_temp - splash_holder.set_reagent_temp((total_temp / reactants.len) + extra_heat) // Average temperature of reagents + extra heat. + splash_holder.set_reagent_temp((total_temp / length(reactants)) + extra_heat) // Average temperature of reagents + extra heat. if(splash_holder.total_volume && affected_range >= 0) //The possible reactions didnt use up all reagents, so we spread it around. var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() @@ -63,7 +63,7 @@ reactable |= A if(extra_heat >= 300) T.hotspot_expose(extra_heat*2, 5) - if(!reactable.len) //Nothing to react with. Probably means we're in nullspace. + if(!length(reactable)) //Nothing to react with. Probably means we're in nullspace. return for(var/thing in reactable) var/atom/A = thing diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 96eb6f637b2..c20c2c4cdaa 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -165,7 +165,7 @@ var/beakerContents[0] var/beakerCurrentVolume = 0 - if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) + if(beaker && beaker.reagents && length(beaker.reagents.reagent_list)) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "id"=R.id, "volume" = R.volume))) // list in a list because Byond merges the first list... beakerCurrentVolume += R.volume diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 78b8fe058d0..67d620b2e7e 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -435,7 +435,7 @@ data["loaded_pill_bottle"] = loaded_pill_bottle ? TRUE : FALSE if(loaded_pill_bottle) data["loaded_pill_bottle_name"] = loaded_pill_bottle.name - data["loaded_pill_bottle_contents_len"] = loaded_pill_bottle.contents.len + data["loaded_pill_bottle_contents_len"] = length(loaded_pill_bottle.contents) data["loaded_pill_bottle_storage_slots"] = loaded_pill_bottle.storage_slots data["loaded_pill_bottle_style"] = loaded_pill_bottle.wrapper_color diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index 92f15a54547..51862c1a89c 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -28,7 +28,7 @@ /obj/machinery/computer/pandemic/proc/GetVirusByIndex(index) if(beaker && beaker.reagents) - if(beaker.reagents.reagent_list.len) + if(length(beaker.reagents.reagent_list)) var/datum/reagent/blood/BL = locate() in beaker.reagents.reagent_list if(BL) if(BL.data && BL.data["viruses"]) @@ -37,7 +37,7 @@ /obj/machinery/computer/pandemic/proc/GetResistancesByIndex(index) if(beaker && beaker.reagents) - if(beaker.reagents.reagent_list.len) + if(length(beaker.reagents.reagent_list)) var/datum/reagent/blood/BL = locate() in beaker.reagents.reagent_list if(BL) if(BL.data && BL.data["resistances"]) @@ -258,7 +258,7 @@ if(B) Blood = B break - if(!R.total_volume||!R.reagent_list.len) + if(!R.total_volume||!length(R.reagent_list)) dat += "The beaker is empty
    " else if(!Blood) dat += "No blood sample found in beaker." @@ -272,7 +272,7 @@ if(Blood.data["viruses"]) var/list/vir = Blood.data["viruses"] - if(vir.len) + if(length(vir)) var/i = 0 for(var/thing in Blood.data["viruses"]) var/datum/disease/D = thing @@ -314,7 +314,7 @@ dat += "
    Contains antibodies to: " if(Blood.data["resistances"]) var/list/res = Blood.data["resistances"] - if(res.len) + if(length(res)) dat += "
      " var/i = 0 for(var/type in Blood.data["resistances"]) @@ -335,7 +335,7 @@ dat += "nothing
      " else dat += "nothing
      " - dat += "
      Eject beaker[((R.total_volume&&R.reagent_list.len) ? "-- Empty and eject beaker":"")]
      " + dat += "
      Eject beaker[((R.total_volume&&length(R.reagent_list)) ? "-- Empty and eject beaker":"")]
      " dat += "Close" var/datum/browser/popup = new(user, "pandemic", name, 575, 400) diff --git a/code/modules/reagents/chemistry/reagents/alcohol.dm b/code/modules/reagents/chemistry/reagents/alcohol.dm index e72a81a8a68..f5fc09e778d 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol.dm @@ -1454,7 +1454,7 @@ alcohol_description = "watery" //How the hell did you get negative boozepwr? var/list/fruits = list() - if(names_in_order.len <= 3) + if(length(names_in_order) <= 3) fruits = names_in_order else for(var/i in 1 to 3) @@ -1464,10 +1464,10 @@ description = "A [alcohol_description] wine brewed from [fruit_list]." var/flavor = "" - if(!primary_tastes.len) + if(!length(primary_tastes)) primary_tastes = list("[alcohol_description] alcohol") flavor += english_list(primary_tastes) - if(secondary_tastes.len) + if(length(secondary_tastes)) flavor += ", with a hint of " flavor += english_list(secondary_tastes) taste_description = flavor diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 28e66a573fd..d17094ef38b 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -52,7 +52,7 @@ data = counterlist_normalise(supplied_data) /datum/reagent/consumable/nutriment/on_merge(list/newdata, newvolume) - if(!islist(newdata) || !newdata.len) + if(!islist(newdata) || !length(newdata)) return var/list/taste_amounts = list() var/list/other_taste_amounts = newdata.Copy() diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 40b999c4013..b37c3078c1a 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -163,7 +163,7 @@ /obj/item/reagent_containers/hypospray/autoinjector/examine() . = ..() - if(reagents && reagents.reagent_list.len) + if(reagents && length(reagents.reagent_list)) . += "It is currently loaded." else . += "It is spent." diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index fe802e47b96..5745bbb9542 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -57,7 +57,7 @@ if(reagents.chem_temp > 300 || reagents.chem_temp < 280) //harmful temperature attack_log_type = ATKLOG_MOST - if(reagents.reagent_list.len == 1 && reagents.has_reagent("cleaner")) // Only create space cleaner logs if it's burning people from being too hot or cold + if(length(reagents.reagent_list) == 1 && reagents.has_reagent("cleaner")) // Only create space cleaner logs if it's burning people from being too hot or cold if(attack_log_type == ATKLOG_ALMOSTALL) return @@ -245,7 +245,7 @@ var/turf/T2 = get_step(T,turn(direction, -90)) var/list/the_targets = list(T,T1,T2) - for(var/i=1, i<=Sprays.len, i++) + for(var/i=1, i<=length(Sprays), i++) spawn() var/obj/effect/decal/chempuff/D = Sprays[i] if(!D) continue diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 2cad9ad15e3..38b67f3c086 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -101,7 +101,7 @@ var/obj/item/storage/S = I if(!S.removal_allowed_check(user)) return - if((S.allow_quick_empty || S.allow_quick_gather) && S.contents.len) + if((S.allow_quick_empty || S.allow_quick_gather) && length(S.contents)) S.hide_from(user) user.visible_message("[user] empties \the [S] into \the [src].", "You empty \the [S] into \the [src].") for(var/obj/item/O in S.contents) @@ -140,7 +140,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - if(contents.len > 0) + if(length(contents) > 0) to_chat(user, "Eject the items first!") return if(mode==0) // It's off but still not unscrewed @@ -154,7 +154,7 @@ if(mode != required_mode_to_deconstruct) return . = TRUE - if(contents.len > 0) + if(length(contents) > 0) to_chat(user, "Eject the items first!") return if(!I.tool_use_check(user, 0)) @@ -379,7 +379,7 @@ return // check for items in disposal - occupied light - if(contents.len > 0) + if(length(contents) > 0) . += "dispover-full" underlays += emissive_appearance(icon, "dispover-full") @@ -403,7 +403,7 @@ flush_count++ if(flush_count >= flush_every_ticks) - if(contents.len) + if(length(contents)) if(mode == 2) spawn(0) flush() diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index e1bb1e43354..4b1dd9d3eae 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -74,7 +74,7 @@ Note: Must be placed within 3 tiles of the R&D Console to_chat(user, "This doesn't seem to have a tech origin!") return var/list/temp_tech = ConvertReqString2List(O.origin_tech) - if(temp_tech.len == 0) + if(length(temp_tech) == 0) to_chat(user, "You cannot deconstruct this item!") return if(!user.drop_item()) diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 20196a821e1..ce515e4ffe2 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -119,7 +119,7 @@ to_chat(user, "This doesn't seem to have a tech origin!") return var/list/temp_tech = ConvertReqString2List(O.origin_tech) - if(temp_tech.len == 0) + if(length(temp_tech) == 0) to_chat(user, "You cannot experiment on this item!") return if(!user.drop_item()) @@ -229,7 +229,7 @@ if(prob(probtocheck)) result = TRUE return from[counter+1] - if(counter + 2 < from.len) + if(counter + 2 < length(from)) counter = counter + 2 else counter = 1 @@ -458,7 +458,7 @@ for(var/atom/movable/AM in oview(7,src)) if(!AM.anchored) throwAt.Add(AM) - for(var/counter = 1, counter < throwAt.len, ++counter) + for(var/counter = 1, counter < length(throwAt), ++counter) var/atom/movable/cast = throwAt[counter] spawn(0) cast.throw_at(pick(throwAt),10,1) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index b0d3fd76996..20c192a0b3a 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -385,7 +385,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, message_admins("[machine] exploit attempted by [key_name(usr, TRUE)]!") return - if(being_built.make_reagents.len) // build_type should equal BIOGENERATOR though.. + if(length(being_built.make_reagents)) // build_type should equal BIOGENERATOR though.. return var/max_amount = is_lathe ? 10 : 1 diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm index 18468233723..2680f8c821c 100644 --- a/code/modules/research/research.dm +++ b/code/modules/research/research.dm @@ -77,7 +77,7 @@ research holder datum. //Checks to see if tech has all the required pre-reqs. //Input: datum/tech; Output: 0/1 (false/true) /datum/research/proc/TechHasReqs(datum/tech/T) - if(T.req_tech.len == 0) + if(length(T.req_tech) == 0) return TRUE for(var/req in T.req_tech) var/datum/tech/known = known_tech[req] @@ -92,7 +92,7 @@ research holder datum. return FALSE if(D.requires_whitelist && !(known_designs[D.id])) return FALSE - if(D.req_tech.len == 0) + if(length(D.req_tech) == 0) return TRUE for(var/req in D.req_tech) var/datum/tech/known = known_tech[req] diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index acb29011863..3d3f71e5174 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -59,12 +59,12 @@ if(!files) files = new /datum/research(src) var/list/temp_list - if(!id_with_upload.len) + if(!length(id_with_upload)) temp_list = list() temp_list = splittext(id_with_upload_string, ";") for(var/N in temp_list) id_with_upload += text2num(N) - if(!id_with_download.len) + if(!length(id_with_download)) temp_list = list() temp_list = splittext(id_with_download_string, ";") for(var/N in temp_list) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index caaa7f0bec2..fde9a420793 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -239,7 +239,7 @@ if(QDELETED(src) || QDELETED(SM)) return - if(candidates.len) + if(length(candidates)) var/mob/C = pick(candidates) SM.key = C.key dust_if_respawnable(C) diff --git a/code/modules/response_team/ert.dm b/code/modules/response_team/ert.dm index b1bf75e3c95..65893025fc1 100644 --- a/code/modules/response_team/ert.dm +++ b/code/modules/response_team/ert.dm @@ -112,10 +112,10 @@ GLOBAL_LIST_EMPTY(ert_request_messages) /proc/dispatch_response_team(list/response_team_members, list/datum/async_input/ert_gender_prefs, list/datum/async_input/ert_species_prefs, list/datum/async_input/ert_role_prefs) var/spawn_index = 1 - for(var/i = 1, i <= response_team_members.len, i++) - if(spawn_index > GLOB.emergencyresponseteamspawn.len) + for(var/i = 1, i <= length(response_team_members), i++) + if(spawn_index > length(GLOB.emergencyresponseteamspawn)) break - if(!GLOB.active_team.get_slot_list().len) + if(!length(GLOB.active_team.get_slot_list())) break var/gender_pref = ert_gender_prefs[i].result var/species_pref = ert_species_prefs[i].result diff --git a/code/modules/ruins/lavalandruin_code/puzzle.dm b/code/modules/ruins/lavalandruin_code/puzzle.dm index 8c529f5811d..882390fe9f5 100644 --- a/code/modules/ruins/lavalandruin_code/puzzle.dm +++ b/code/modules/ruins/lavalandruin_code/puzzle.dm @@ -57,7 +57,7 @@ if(finished) return - if(elements.len < 8) //Someone broke it + if(length(elements) < 8) //Someone broke it qdel(src) //Check if everything is in place @@ -98,9 +98,9 @@ current_ordering += E.id var/swap_tally = 0 - for(var/i in 1 to current_ordering.len) + for(var/i in 1 to length(current_ordering)) var/checked_value = current_ordering[i] - for(var/j in i to current_ordering.len) + for(var/j in i to length(current_ordering)) if(current_ordering[j] < checked_value) swap_tally++ diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 10a708a107c..cea1e0fae7d 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -54,7 +54,7 @@ return var/list/cardaccess = W:access - if(!istype(cardaccess, /list) || !cardaccess.len) //no access + if(!istype(cardaccess, /list) || !length(cardaccess)) //no access to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") return @@ -74,10 +74,10 @@ if("Authorize") if(!authorized.Find(W:registered_name)) authorized += W:registered_name - if(auth_need - authorized.len > 0) + if(auth_need - length(authorized) > 0) message_admins("[key_name_admin(user)] has authorized early shuttle launch.") log_game("[key_name(user)] has authorized early shuttle launch in ([x], [y], [z]).") - GLOB.minor_announcement.Announce("[auth_need - authorized.len] more authorization(s) needed until shuttle is launched early") + GLOB.minor_announcement.Announce("[auth_need - length(authorized)] more authorization(s) needed until shuttle is launched early") else message_admins("[key_name_admin(user)] has launched the emergency shuttle [seconds] seconds before launch.") log_game("[key_name(user)] has launched the emergency shuttle in ([x], [y], [z]) [seconds] seconds before launch.") @@ -86,10 +86,10 @@ if("Repeal") if(authorized.Remove(W:registered_name)) - GLOB.minor_announcement.Announce("[auth_need - authorized.len] authorizations needed until shuttle is launched early") + GLOB.minor_announcement.Announce("[auth_need - length(authorized)] authorizations needed until shuttle is launched early") if("Abort") - if(authorized.len) + if(length(authorized)) GLOB.minor_announcement.Announce("All authorizations to launch the shuttle early have been revoked.") authorized.Cut() @@ -341,7 +341,7 @@ // The emergency shuttle doesn't work like others so this // ripple check is slightly different - if(!ripples.len && (time_left <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_ESCAPE))) + if(!length(ripples) && (time_left <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_ESCAPE))) var/destination if(mode == SHUTTLE_CALL) destination = SSshuttle.getDock("emergency_home") diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 68b254a349d..efefbf9a7eb 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -41,7 +41,7 @@ return ..() /obj/machinery/computer/camera_advanced/shuttle_docker/GrantActions(mob/living/user) - if(jumpto_ports.len) + if(length(jumpto_ports)) jump_action = new /datum/action/innate/camera_jump/shuttle_docker ..() if(place_action) @@ -165,7 +165,7 @@ var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj var/list/image_cache = the_eye.placement_images the_eye.setDir(turn(the_eye.dir, -90)) - for(var/i in 1 to image_cache.len) + for(var/i in 1 to length(image_cache)) var/image/pic = image_cache[i] var/list/coords = image_cache[pic] var/Tmp = coords[1] @@ -187,7 +187,7 @@ var/list/bounds = shuttle_port.return_coords(the_eye.x - x_offset, the_eye.y - y_offset, the_eye.dir) var/list/overlappers = SSshuttle.get_dock_overlap(bounds[1], bounds[2], bounds[3], bounds[4], the_eye.z) var/list/image_cache = the_eye.placement_images - for(var/i in 1 to image_cache.len) + for(var/i in 1 to length(image_cache)) var/image/I = image_cache[i] var/list/coords = image_cache[I] var/turf/T = locate(eyeturf.x + coords[1], eyeturf.y + coords[2], eyeturf.z) @@ -227,7 +227,7 @@ return SHUTTLE_DOCKER_BLOCKED // Checking for overlapping dock boundaries - for(var/i in 1 to overlappers.len) + for(var/i in 1 to length(overlappers)) var/obj/docking_port/port = overlappers[i] if(port == my_port || locate(port) in jumpto_ports) continue diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 824574ac011..13fcbb8952c 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -173,9 +173,9 @@ SSshuttle.stationary += src if(!id) - id = "[SSshuttle.stationary.len]" + id = "[length(SSshuttle.stationary)]" if(name == "dock") - name = "dock[SSshuttle.stationary.len]" + name = "dock[length(SSshuttle.stationary)]" #ifdef DOCKING_PORT_HIGHLIGHT highlight("#f00") @@ -254,7 +254,7 @@ register() shuttle_areas = list() var/list/all_turfs = return_ordered_turfs(x, y, z, dir) - for(var/i in 1 to all_turfs.len) + for(var/i in 1 to length(all_turfs)) var/turf/curT = all_turfs[i] var/area/cur_area = curT.loc if(istype(cur_area, areaInstance)) @@ -267,9 +267,9 @@ SSshuttle.mobile += src if(!id) - id = "[SSshuttle.mobile.len]" + id = "[length(SSshuttle.mobile)]" if(name == "shuttle") - name = "shuttle[SSshuttle.mobile.len]" + name = "shuttle[length(SSshuttle.mobile)]" return 1 @@ -393,7 +393,7 @@ var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance) //remove area surrounding docking port - if(areaInstance.contents.len) + if(length(areaInstance.contents)) var/area/A0 = locate("[area_type]") if(!A0) A0 = new area_type(null) @@ -414,7 +414,7 @@ ripples += new /obj/effect/temp_visual/ripple(i) /obj/docking_port/mobile/proc/remove_ripples() - if(ripples.len) + if(length(ripples)) for(var/i in ripples) qdel(i) ripples.Cut() @@ -426,7 +426,7 @@ var/list/ripple_turfs = list() - for(var/i in 1 to L0.len) + for(var/i in 1 to length(L0)) var/turf/T0 = L0[i] if(!T0) continue @@ -474,7 +474,7 @@ rotation = SIMPLIFY_DEGREES(rotation) //remove area surrounding docking port - if(areaInstance.contents.len) + if(length(areaInstance.contents)) var/area/A0 = locate("[area_type]") if(!A0) A0 = new area_type(null) @@ -487,7 +487,7 @@ //move or squish anything in the way ship at destination roadkill(L0, L1, S1.dir) - for(var/i in 1 to L0.len) + for(var/i in 1 to length(L0)) var/turf/T0 = L0[i] if(!T0) continue @@ -610,7 +610,7 @@ A.unlock() /obj/docking_port/mobile/proc/roadkill(list/L0, list/L1, dir) - for(var/i in 1 to L0.len) + for(var/i in 1 to length(L0)) var/turf/T0 = L0[i] var/turf/T1 = L1[i] if(!T0 || !T1) @@ -667,7 +667,7 @@ destination = null /obj/docking_port/mobile/proc/check_effects() - if(!ripples.len) + if(!length(ripples)) if((mode == SHUTTLE_CALL) || (mode == SHUTTLE_RECALL)) var/tl = timeLeft(1) if(tl <= SHUTTLE_RIPPLE_TIME) @@ -835,7 +835,7 @@ if(!M.check_dock(S)) continue docking_ports[++docking_ports.len] = list("name" = S.name, "id" = S.id) - data["docking_ports_len"] = docking_ports.len + data["docking_ports_len"] = length(docking_ports) data["admin_controlled"] = admin_controlled return data @@ -989,11 +989,11 @@ /turf/proc/copyTurf(turf/T) if(T.type != type) var/obj/O - if(underlays.len) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay + if(length(underlays)) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay O = new() O.underlays.Add(T) T.ChangeTurf(type, keep_icon = FALSE) - if(underlays.len) + if(length(underlays)) T.underlays = O.underlays if(T.icon_state != icon_state) T.icon_state = icon_state diff --git a/code/modules/space_management/space_level.dm b/code/modules/space_management/space_level.dm index 44c692363af..5512447e346 100644 --- a/code/modules/space_management/space_level.dm +++ b/code/modules/space_management/space_level.dm @@ -165,11 +165,11 @@ GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loade SSatoms.InitializeAtoms(our_atoms, FALSE) log_debug("Primary initialization finished in [stop_watch(watch)]s.") our_atoms.Cut() - if(pipes.len) + if(length(pipes)) do_pipes(pipes) - if(cables.len) + if(length(cables)) do_cables(cables) - if(late_maps.len) + if(length(late_maps)) do_late_maps(late_maps) /datum/space_level/proc/do_pipes(list/pipes) diff --git a/code/modules/space_management/space_transition.dm b/code/modules/space_management/space_transition.dm index f6030cfdf5d..195e100f414 100644 --- a/code/modules/space_management/space_transition.dm +++ b/code/modules/space_management/space_transition.dm @@ -200,8 +200,8 @@ /datum/spacewalk_grid/Destroy() for(var/datum/point/P in filled_nodes) release_node(P) - if(available_nodes.len > 1) - log_debug("Multiple nodes left behind after SW grid qdel: [available_nodes.len]") + if(length(available_nodes) > 1) + log_debug("Multiple nodes left behind after SW grid qdel: [length(available_nodes)]") for(var/datum/point/P in available_nodes) log_debug("([P.x],[P.y])") return ..() @@ -337,7 +337,7 @@ // Now, we pop entries in a random order from our list of space levels // and assign its connections based on the grid - while(crosslinks.len) + while(length(crosslinks)) D = pick(crosslinks) crosslinks.Remove(D) // Add it to our space grid diff --git a/code/modules/space_management/zlevel_manager.dm b/code/modules/space_management/zlevel_manager.dm index 5582288a813..ab9cc4b92a9 100644 --- a/code/modules/space_management/zlevel_manager.dm +++ b/code/modules/space_management/zlevel_manager.dm @@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new()) // Populate our space level list // and prepare space transitions /datum/zlev_manager/proc/initialize() - var/num_official_z_levels = GLOB.map_transition_config.len + var/num_official_z_levels = length(GLOB.map_transition_config) var/k = 1 // First take care of "Official" z levels, without visiting levels outside of the list @@ -146,9 +146,9 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new()) /datum/zlev_manager/proc/allocate_space(width, height) if(width > world.maxx || height > world.maxy) throw EXCEPTION("Too much space requested! \[[width],[height]\]") - if(!heaps.len) + if(!length(heaps)) heaps.len++ - heaps[heaps.len] = add_new_heap() + heaps[length(heaps)] = add_new_heap() var/datum/space_level/heap/our_heap var/weve_got_vacancy = 0 for(our_heap in heaps) @@ -160,7 +160,7 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new()) if(!weve_got_vacancy) heaps.len++ our_heap = add_new_heap() - heaps[heaps.len] = our_heap + heaps[length(heaps)] = our_heap return our_heap.allocate(width, height) /datum/zlev_manager/proc/free_space(datum/space_chunk/C) diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 794b0f1fadc..f2c6c00fc3b 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -53,7 +53,7 @@ if(..()) return TRUE for(var/obj/machinery/dna_vault/V in GLOB.machines) - if(V.animals.len >= animal_count && V.plants.len >= plant_count && V.dna.len >= human_count && is_station_contact(V.z)) + if(length(V.animals) >= animal_count && length(V.plants) >= plant_count && length(V.dna) >= human_count && is_station_contact(V.z)) return TRUE return FALSE @@ -268,7 +268,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/m return TRUE /obj/machinery/dna_vault/proc/check_goal() - if(plants.len >= plants_max && animals.len >= animals_max && dna.len >= dna_max) + if(length(plants) >= plants_max && length(animals) >= animals_max && length(dna) >= dna_max) completed = TRUE /obj/machinery/dna_vault/attackby(obj/item/I, mob/user, params) diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index 254ef1d2dfc..a1e487034ab 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -32,7 +32,7 @@ if(!A.active || !is_station_level(A.z)) continue coverage |= view(A.kill_range, A) - return coverage.len + return length(coverage) /obj/item/circuitboard/computer/sat_control board_name = "Satellite Network Control" diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index f95877c9a22..0088aaa7fdc 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -146,7 +146,7 @@ return TRUE /obj/item/organ/internal/cyberimp/arm/ui_action_click() - if(crit_fail || (!holder && !contents.len)) + if(crit_fail || (!holder && !length(contents))) to_chat(owner, "The implant doesn't respond. It seems to be broken...") return @@ -157,7 +157,7 @@ if(!holder || (holder in src)) holder = null - if(contents.len == 1) + if(length(contents) == 1) Extend(contents[1]) else radial_menu(owner) diff --git a/code/modules/surgery/organs/blood.dm b/code/modules/surgery/organs/blood.dm index c3b4c13111f..a74fbc7ea4e 100644 --- a/code/modules/surgery/organs/blood.dm +++ b/code/modules/surgery/organs/blood.dm @@ -58,9 +58,9 @@ if(BP.is_robotic()) continue - //We want an accurate reading of .len + //We want an accurate reading of length() listclearnulls(BP.embedded_objects) - temp_bleed += 0.5*BP.embedded_objects.len + temp_bleed += 0.5 * length(BP.embedded_objects) if(brutedamage >= 20) temp_bleed += (brutedamage * 0.013) @@ -191,7 +191,7 @@ blood_data["viruses"] += D.Copy() blood_data["blood_DNA"] = copytext(dna.unique_enzymes,1,0) - if(resistances && resistances.len) + if(resistances && length(resistances)) blood_data["resistances"] = resistances.Copy() var/list/temp_chem = list() for(var/datum/reagent/R in reagents.reagent_list) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 889fabfc84f..8f313f51f10 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -254,7 +254,7 @@ // High brute damage or sharp objects may damage internal organs if(internal_organs && (brute_dam >= max_limb_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB)))) // Damage an internal organ - if(internal_organs && internal_organs.len) + if(internal_organs && length(internal_organs)) var/obj/item/organ/internal/I = pick(internal_organs) I.receive_damage(brute * 0.5) @@ -304,9 +304,9 @@ for(var/organ in children) if(organ) possible_points += organ - if(forbidden_limbs.len) + if(length(forbidden_limbs)) possible_points -= forbidden_limbs - if(possible_points.len) + if(length(possible_points)) //And pass the pain around var/obj/item/organ/external/target = pick(possible_points) target.receive_damage(brute, burn, sharp, used_weapon, forbidden_limbs + src, ignore_resists = TRUE) //If the damage was reduced before, don't reduce it again @@ -464,7 +464,7 @@ Note that amputating the affected organ does in fact remove the infection from t for(var/obj/item/organ/internal/I in internal_organs) if(I.germ_level < germ_level) candidate_organs |= I - if(candidate_organs.len) + if(length(candidate_organs)) target_organ = pick(candidate_organs) if(target_organ) diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm index fa5d3f53d58..6d4c69f1fec 100644 --- a/code/modules/surgery/organs/organ_icon.dm +++ b/code/modules/surgery/organs/organ_icon.dm @@ -5,7 +5,7 @@ child_icons.Cut() // This is a kludge, only one icon has more than one generation of children though. for(var/obj/item/organ/external/organ in contents) - if(organ.children && organ.children.len) + if(organ.children && length(organ.children)) for(var/obj/item/organ/external/child in organ.children) overlays += child.mob_icon child_icons += child.mob_icon diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 8bd59f17ec9..807f645a082 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -168,7 +168,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby")) continue listeners += L - if(!listeners.len) + if(!length(listeners)) next_command = world.time + cooldown_none return @@ -209,9 +209,9 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby")) //Cut out the job so it doesn't trigger commands found_string = L.mind.assigned_role - if(specific_listeners.len) + if(length(specific_listeners)) listeners = specific_listeners - power_multiplier *= (1 + (1/specific_listeners.len)) //2x on a single guy, 1.5x on two and so on + power_multiplier *= (1 + (1/length(specific_listeners))) //2x on a single guy, 1.5x on two and so on message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1) //STUN diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm index d12fb7780f6..21393d49fc1 100644 --- a/code/modules/telesci/gps.dm +++ b/code/modules/telesci/gps.dm @@ -228,7 +228,7 @@ GLOBAL_LIST_EMPTY(GPS_list) tagged |= T /obj/item/gps/visible_debug/proc/clear() - while(tagged.len) + while(length(tagged)) var/turf/T = pop(tagged) T.color = initial(T.color) T.maptext = initial(T.maptext) diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index 0e3461145a2..8c0397ad2ed 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -112,7 +112,7 @@ t += "Set Power" t += "
      " - for(var/i = 1; i <= power_options.len; i++) + for(var/i = 1; i <= length(power_options); i++) if(crystals + telepad.efficiency < i) t += "[power_options[i]]" continue diff --git a/code/modules/tgs/core/tgs_version.dm b/code/modules/tgs/core/tgs_version.dm index a5dae1241a3..310e7ab55cb 100644 --- a/code/modules/tgs/core/tgs_version.dm +++ b/code/modules/tgs/core/tgs_version.dm @@ -4,11 +4,11 @@ var/list/version_bits = splittext(deprefixed_parameter, ".") suite = text2num(version_bits[1]) - if(version_bits.len > 1) + if(length(version_bits) > 1) minor = text2num(version_bits[2]) - if(version_bits.len > 2) + if(length(version_bits) > 2) patch = text2num(version_bits[3]) - if(version_bits.len == 4) + if(length(version_bits) == 4) deprecated_patch = text2num(version_bits[4]) /datum/tgs_version/proc/Valid(allow_wildcards = FALSE) diff --git a/code/modules/tgs/v3210/v3_api.dm b/code/modules/tgs/v3210/v3_api.dm index ac5e8e4cf6d..09e18f29f61 100644 --- a/code/modules/tgs/v3210/v3_api.dm +++ b/code/modules/tgs/v3210/v3_api.dm @@ -64,17 +64,17 @@ instance_name = "TG Station Server" //maybe just upgraded var/list/logs = TGS_FILE2LIST(".git/logs/HEAD") - if(logs.len) - logs = splittext(logs[logs.len], " ") - if(logs.len >= 2) + if(length(logs)) + logs = splittext(logs[length(logs)], " ") + if(length(logs) >= 2) commit = logs[2] else TGS_ERROR_LOG("Error parsing commit logs") logs = TGS_FILE2LIST(".git/logs/refs/remotes/origin/master") - if(logs.len) - logs = splittext(logs[logs.len], " ") - if(logs.len >= 2) + if(length(logs)) + logs = splittext(logs[length(logs)], " ") + if(length(logs) >= 2) originmastercommit = logs[2] else TGS_ERROR_LOG("Error parsing origin commmit logs") diff --git a/code/modules/tgui/modules/ert_manager.dm b/code/modules/tgui/modules/ert_manager.dm index d68f42cd520..d204d60b34b 100644 --- a/code/modules/tgui/modules/ert_manager.dm +++ b/code/modules/tgui/modules/ert_manager.dm @@ -36,7 +36,7 @@ data["cyb"] = cyborg_slots data["secborg"] = cyborg_security data["total"] = commander_slots + security_slots + medical_slots + engineering_slots + janitor_slots + paranormal_slots + cyborg_slots - data["spawnpoints"] = GLOB.emergencyresponseteamspawn.len + data["spawnpoints"] = length(GLOB.emergencyresponseteamspawn) data["ert_request_messages"] = GLOB.ert_request_messages return data diff --git a/code/modules/tgui/modules/law_manager.dm b/code/modules/tgui/modules/law_manager.dm index 65f4c23f78d..001a8bdc31c 100644 --- a/code/modules/tgui/modules/law_manager.dm +++ b/code/modules/tgui/modules/law_manager.dm @@ -198,7 +198,7 @@ for(var/datum/ai_law/AL in laws) packaged_laws[++packaged_laws.len] = list("law" = AL.law, "index" = AL.get_index(), "state" = owner.laws.get_state_law(AL), "ref" = "\ref[AL]") data[field] = packaged_laws - data["has_[field]"] = packaged_laws.len + data["has_[field]"] = length(packaged_laws) /datum/ui_module/law_manager/proc/package_multiple_laws(list/datum/ai_laws/laws) var/list/law_sets = list() diff --git a/code/modules/tgui/tgui_panel/telemetry.dm b/code/modules/tgui/tgui_panel/telemetry.dm index 6b63903d224..d0ba2f5218b 100644 --- a/code/modules/tgui/tgui_panel/telemetry.dm +++ b/code/modules/tgui/tgui_panel/telemetry.dm @@ -67,7 +67,7 @@ return var/list/row = telemetry_connections[i] // Check for a malformed history object - if(!row || row.len < 3 || (!row["ckey"] || !row["address"] || !row["computer_id"])) + if(!row || length(row) < 3 || (!row["ckey"] || !row["address"] || !row["computer_id"])) return if(world.IsBanned(row["ckey"], row["address"], row["computer_id"], FALSE, FALSE, FALSE, FALSE, FALSE)) found = row