From 472ef33488aa261dec6d7b059ff585e0874abfbf Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sun, 7 Mar 2021 20:01:45 -0700 Subject: [PATCH] nukes some unmanaged global variables (probably merge this fast as it touches a hundred+ files) (#2829) * replacements * indents --- code/controllers/subsystems/skybox.dm | 2 +- code/game/dna/dna_modifier.dm | 2 +- code/game/gamemodes/cult/cult_items.dm | 2 +- code/game/gamemodes/cult/narsie.dm | 4 ++-- code/game/gamemodes/events/black_hole.dm | 2 +- code/game/gamemodes/events/clang.dm | 2 +- code/game/gamemodes/events/dust.dm | 2 +- code/game/gamemodes/meteor/meteors.dm | 2 +- .../technomancer/spells/condensation.dm | 4 ++-- code/game/machinery/_machinery.dm | 2 +- code/game/machinery/adv_med.dm | 2 +- code/game/machinery/computer3/networking.dm | 2 +- code/game/machinery/doors/firedoor.dm | 4 ++-- code/game/machinery/pipe/construction.dm | 2 +- code/game/machinery/teleporter.dm | 4 ++-- code/game/machinery/wall_frames.dm | 6 +++--- code/game/objects/effects/alien/aliens.dm | 2 +- code/game/objects/effects/chem/chemsmoke.dm | 4 ++-- code/game/objects/effects/chem/foam.dm | 2 +- .../objects/effects/decals/Cleanable/fuel.dm | 2 +- code/game/objects/effects/decals/contraband.dm | 4 ++-- code/game/objects/effects/effect_system.dm | 12 ++++++------ code/game/objects/effects/explosion_particles.dm | 2 +- .../effects/map_effects/effect_emitter.dm | 2 +- code/game/objects/effects/spawners/gibspawner.dm | 6 +++--- code/game/objects/explosion_recursive.dm | 4 ++-- code/game/objects/items/apc_frame.dm | 2 +- code/game/objects/items/blueprints.dm | 2 +- code/game/objects/items/weapons/barrier_tape.dm | 16 ++++++++-------- code/game/objects/items/weapons/duct_tape.dm | 2 +- code/game/objects/items/weapons/syndie.dm | 2 +- code/game/objects/items/weapons/teleportation.dm | 4 ++-- code/game/objects/structures/catwalk.dm | 2 +- code/game/objects/structures/cliff.dm | 4 ++-- code/game/objects/structures/lattice.dm | 6 +++--- code/game/objects/structures/window_spawner.dm | 2 +- code/game/turfs/simulated/dungeon/wall.dm | 4 ++-- code/game/turfs/simulated/floor_attackby.dm | 6 +++--- code/game/turfs/simulated/floor_icon.dm | 2 +- code/game/turfs/simulated/floor_types.dm | 4 ++-- code/game/turfs/simulated/outdoors/outdoors.dm | 2 +- code/game/turfs/simulated/wall_types_vr.dm | 8 ++++---- code/global.dm | 11 ----------- code/modules/admin/verbs/atmosdebug.dm | 2 +- code/modules/admin/verbs/smite_vr.dm | 2 +- .../ai/aI_holder_subtypes/simple_mob_ai.dm | 2 +- code/modules/ai/ai_holder_combat.dm | 8 ++++---- code/modules/ai/ai_holder_disabled.dm | 6 +++--- code/modules/ai/ai_holder_movement.dm | 2 +- code/modules/atmospherics/_atmos_setup.dm | 4 ++-- .../binary_devices/algae_generator_vr.dm | 4 ++-- .../components/omni_devices/omni_base.dm | 2 +- .../atmospherics/components/unary/vent_pump.dm | 2 +- code/modules/atmospherics/components/valve.dm | 2 +- code/modules/atmospherics/mainspipe.dm | 10 +++++----- code/modules/atmospherics/pipes/he_pipes.dm | 2 +- code/modules/atmospherics/pipes/manifold.dm | 6 +++--- code/modules/atmospherics/pipes/simple.dm | 2 +- code/modules/atmospherics/zas/Fire.dm | 4 ++-- code/modules/atmospherics/zas/Turf.dm | 12 ++++++------ code/modules/awaymissions/gateway.dm | 4 ++-- code/modules/blob2/blobs/base_blob.dm | 4 ++-- code/modules/blob2/overmind/powers.dm | 4 ++-- code/modules/clothing/spacesuits/rig/rig.dm | 2 +- code/modules/economy/cash_register.dm | 2 +- code/modules/events/ian_storm_vr.dm | 2 +- code/modules/events/meteors.dm | 2 +- code/modules/food/kitchen/gibber.dm | 2 +- .../modules/gamemaster/actions/meteor_defense.dm | 4 ++-- .../gamemaster/actions/surprise_meteor.dm | 4 ++-- code/modules/hydroponics/seed.dm | 2 +- code/modules/hydroponics/spreading/spreading.dm | 2 +- .../hydroponics/spreading/spreading_growth.dm | 2 +- .../hydroponics/spreading/spreading_response.dm | 2 +- .../core/assemblies/generic.dm | 4 ++-- .../core/special_pins/dir_pin.dm | 2 +- code/modules/maps/tg/reader.dm | 2 +- code/modules/materials/materials.dm | 2 +- code/modules/mining/machine_processing.dm | 4 ++-- code/modules/mining/machine_stacking.dm | 4 ++-- code/modules/mining/machine_unloading.dm | 4 ++-- code/modules/mining/mine_turfs.dm | 10 +++++----- code/modules/mining/mint.dm | 4 ++-- code/modules/mob/living/bot/bot.dm | 4 ++-- .../mob/living/carbon/alien/diona/diona.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 8 ++++---- .../mob/living/carbon/human/human_attackhand.dm | 2 +- .../mob/living/carbon/human/human_movement.dm | 2 +- .../carbon/human/species/station/monkey.dm | 2 +- .../mob/living/carbon/human/unarmed_attack.dm | 2 +- code/modules/mob/living/carbon/metroid/life.dm | 4 ++-- .../subtypes/animal/giant_spider/hunter.dm | 2 +- .../simple_mob/subtypes/animal/sif/racoon.dm | 2 +- .../subtypes/vore/shadekin/shadekin.dm | 2 +- code/modules/mob/mob_movement.dm | 2 +- code/modules/multiz/pipes.dm | 4 ++-- code/modules/organs/organ_external.dm | 8 ++++---- code/modules/overmap/turfs.dm | 2 +- code/modules/paperwork/papershredder.dm | 2 +- code/modules/planet/frozen_planet.dm | 6 +++--- code/modules/planet/sif.dm | 4 ++-- code/modules/planet/virgo3b_vr.dm | 4 ++-- code/modules/planet/weather.dm | 2 +- code/modules/power/antimatter/shielding.dm | 8 ++++---- code/modules/power/cable.dm | 4 ++-- code/modules/power/generator.dm | 2 +- code/modules/power/power.dm | 6 +++--- code/modules/power/singularity/singularity.dm | 2 +- code/modules/power/smes.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 2 +- code/modules/projectiles/ammunition.dm | 4 ++-- code/modules/projectiles/projectile/special.dm | 2 +- .../Chemistry-Reagents-Dispenser.dm | 4 ++-- .../Chemistry-Reagents-Food-Drinks.dm | 2 +- .../Chemistry-Reagents-Toxins.dm | 6 +++--- code/modules/recycling/conveyor2.dm | 2 +- code/modules/recycling/disposal-construction.dm | 2 +- code/modules/recycling/disposal.dm | 6 +++--- code/modules/resleeving/machines.dm | 2 +- code/modules/shieldgen/energy_field.dm | 6 +++--- code/modules/shieldgen/handheld_defuser.dm | 2 +- code/modules/shieldgen/shield_diffuser.dm | 2 +- code/modules/tables/tables.dm | 4 ++-- code/modules/turbolift/turbolift_door.dm | 4 ++-- code/modules/vehicles/vehicle.dm | 4 ++-- maps/nsv_triumph/triumph_virgo3b.dm | 6 +++--- maps/tether/tether_virgo3b.dm | 6 +++--- .../code/modules/shadekin/shadekin.dm | 2 +- tools/TagMatcher/tag-matcher.py | 10 +++++----- 129 files changed, 233 insertions(+), 244 deletions(-) diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index b00f839deb5..c7c3cfd71f9 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -60,7 +60,7 @@ SUBSYSTEM_DEF(skybox) speedspace_cache["EW_[i]"] = MA // Over-the-edge images - for (var/dir in alldirs) + for (var/dir in GLOB.alldirs) var/mutable_appearance/MA = new(normal_space) var/matrix/M = matrix() var/horizontal = (dir & (WEST|EAST)) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index ef93e0242eb..34459d91c7c 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -310,7 +310,7 @@ /obj/machinery/computer/scan_consolenew/proc/scan_for_scanner() connected = null - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) connected = locate(/obj/machinery/dna_scannernew) in get_step(src, dir) if(connected) break diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 7491a093ff1..98868a2bcd9 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -34,7 +34,7 @@ to_chat(user, "The blade hisses, forcing itself from your manipulators. \The [src] will only allow mortals to wield it against foes, not kin.") user.drop_from_inventory(src, src.loc) - throw_at(get_edge_target_turf(src, pick(alldirs)), rand(1,3), throw_speed) + throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1,3), throw_speed) var/spooky = pick('sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg', 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/wail.ogg') playsound(loc, spooky, 50, 1) diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index 8f8709e26ca..1fac179f6cd 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -101,7 +101,7 @@ var/global/list/narsie_list = list() if(!move_self) return 0 - var/movement_dir = pick(alldirs - last_failed_movement) + var/movement_dir = pick(GLOB.alldirs - last_failed_movement) if(force_move) movement_dir = force_move @@ -119,7 +119,7 @@ var/global/list/narsie_list = list() if(!move_self) return 0 - var/movement_dir = pick(alldirs - last_failed_movement) + var/movement_dir = pick(GLOB.alldirs - last_failed_movement) if(force_move) movement_dir = force_move diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm index 9d5e62608cb..268f651b8f8 100644 --- a/code/game/gamemodes/events/black_hole.dm +++ b/code/game/gamemodes/events/black_hole.dm @@ -54,7 +54,7 @@ //MOVEMENT if( prob(50) && !(process_step % 8)) src.anchored = 0 - step(src,pick(alldirs)) + step(src,pick(GLOB.alldirs)) src.anchored = 1 /obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance) diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index ae73f23900f..717793bcb2e 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -50,7 +50,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 var/starty = 0 var/endy = 0 var/endx = 0 - var/startside = pick(cardinal) + var/startside = pick(GLOB.cardinal) switch(startside) if(NORTH) diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index a0032cd1d0a..1564e86baeb 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -24,7 +24,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. numbers = rand(15,25) dust_type = /obj/effect/space_dust/super - var/startside = pick(cardinal) + var/startside = pick(GLOB.cardinal) for(var/i = 0 to numbers) var/startx = 0 var/starty = 0 diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 84ecf823444..565679e25ac 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -25,7 +25,7 @@ /proc/spawn_meteor(var/list/meteortypes, var/startSide, var/startLevel) if(isnull(startSide)) - startSide = pick(cardinal) + startSide = pick(GLOB.cardinal) if(isnull(startLevel)) startLevel = pick(GLOB.using_map.station_levels - GLOB.using_map.sealed_levels) diff --git a/code/game/gamemodes/technomancer/spells/condensation.dm b/code/game/gamemodes/technomancer/spells/condensation.dm index 67142309191..727d40e3d4b 100644 --- a/code/game/gamemodes/technomancer/spells/condensation.dm +++ b/code/game/gamemodes/technomancer/spells/condensation.dm @@ -21,7 +21,7 @@ if(istype(hit_atom, /turf/simulated) && within_range(hit_atom)) var/turf/simulated/T = hit_atom - for(var/direction in alldirs + null) // null is for the center tile. + for(var/direction in GLOB.alldirs + null) // null is for the center tile. spawn(1) var/turf/desired_turf = get_step(T,direction) if(desired_turf) // This shouldn't fail but... @@ -41,4 +41,4 @@ log_and_message_admins("has wetted the floor with [src] at [T.x],[T.y],[T.z].") else if(hit_atom.reagents && !ismob(hit_atom)) //TODO: Something for the scepter hit_atom.reagents.add_reagent(id = "water", amount = 60, data = null, safety = 0) - adjust_instability(5) \ No newline at end of file + adjust_instability(5) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index d9b1d81d316..2d29cdcdcf0 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -169,7 +169,7 @@ Class Procs: pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.setDir(pick(cardinal)) + pulse2.setDir(pick(GLOB.cardinal)) spawn(10) qdel(pulse2) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 7944e1e0657..f576537dc57 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -77,7 +77,7 @@ if(O.anchored) return 0 //mob is anchored??? if(get_dist(user, src) > 1 || get_dist(user, O) > 1) - return 0 //doesn't use adjacent() to allow for non-cardinal (fuck my life) + return 0 //doesn't use adjacent() to allow for non-GLOB.cardinal (fuck my life) if(!ishuman(user) && !isrobot(user)) return 0 //not a borg or human if(panel_open) diff --git a/code/game/machinery/computer3/networking.dm b/code/game/machinery/computer3/networking.dm index 7b7922a635e..a990e78a64e 100644 --- a/code/game/machinery/computer3/networking.dm +++ b/code/game/machinery/computer3/networking.dm @@ -176,7 +176,7 @@ for(var/obj/O in T) if(istype(O,typekey)) nearby_machines += O - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/T2 = get_step(T,d) for(var/obj/O in T2) if(istype(O,typekey)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 26125b02aed..355f4cf4676 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -61,7 +61,7 @@ LAZYADD(A.all_doors, src) areas_added = list(A) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) A = get_area(get_step(src,direction)) if(istype(A) && !(A in areas_added)) LAZYADD(A.all_doors, src) @@ -447,7 +447,7 @@ overlays += "palert" if(dir_alerts) for(var/d=1;d<=4;d++) - var/cdir = cardinal[d] + var/cdir = GLOB.cardinal[d] for(var/i=1;i<=ALERT_STATES.len;i++) if(dir_alerts[d] & (1<<(i-1))) overlays += new/icon(icon,"alert_[ALERT_STATES[i]]", dir=cdir) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 906e626f680..8aadb34899b 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -157,7 +157,7 @@ Buildable meters setDir(EAST) /obj/item/pipe/trinary/flippable/fixdir() - if(dir in cornerdirs) + if(dir in GLOB.cornerdirs) setDir(turn(dir, 45)) /obj/item/pipe/attack_self(mob/user) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index ae1443b508e..7b9509df4f2 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -19,10 +19,10 @@ var/obj/machinery/teleport/hub/hub // Search surrounding turfs for the station, and then search the station's surrounding turfs for the hub. - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) station = locate(/obj/machinery/teleport/station, get_step(src, direction)) if(station) - for(direction in cardinal) + for(direction in GLOB.cardinal) hub = locate(/obj/machinery/teleport/hub, get_step(station, direction)) if(hub) break diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index d35ba356484..25cb9197e58 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -40,7 +40,7 @@ var/ndir ndir = user.dir - if(!(ndir in cardinal)) + if(!(ndir in GLOB.cardinal)) return var/obj/machinery/M = new build_machine_type(get_turf(src.loc), ndir, 1, frame_type) @@ -63,7 +63,7 @@ else ndir = get_dir(on_wall, user) - if(!(ndir in cardinal)) + if(!(ndir in GLOB.cardinal)) return var/turf/loc = get_turf(user) @@ -145,4 +145,4 @@ icon = 'icons/obj/closet.dmi' icon_state = "fireaxe0101" refund_amt = 4 - build_machine_type = /obj/structure/fireaxecabinet \ No newline at end of file + build_machine_type = /obj/structure/fireaxecabinet diff --git a/code/game/objects/effects/alien/aliens.dm b/code/game/objects/effects/alien/aliens.dm index 4870559e8d5..342830f4fbd 100644 --- a/code/game/objects/effects/alien/aliens.dm +++ b/code/game/objects/effects/alien/aliens.dm @@ -276,7 +276,7 @@ Alien plants should do something if theres a lot of poison color = linked_node.set_color direction_loop: - for(var/dirn in cardinal) + for(var/dirn in GLOB.cardinal) var/turf/T = get_step(src, dirn) if (!istype(T) || T.density || locate(/obj/effect/alien/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space)) diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm index e7a8293a2fe..288a39e5b80 100644 --- a/code/game/objects/effects/chem/chemsmoke.dm +++ b/code/game/objects/effects/chem/chemsmoke.dm @@ -161,7 +161,7 @@ chemholder.reagents.trans_to_obj(smoke, chemholder.reagents.total_volume / dist, copy = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents smoke.icon = I smoke.plane = ABOVE_PLANE - smoke.setDir(pick(cardinal)) + smoke.setDir(pick(GLOB.cardinal)) smoke.pixel_x = -32 + rand(-8, 8) smoke.pixel_y = -32 + rand(-8, 8) walk_to(smoke, T) @@ -197,7 +197,7 @@ while(pending.len) for(var/turf/current in pending) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/turf/target = get_step(current, D) if(wallList) if(istype(target, /turf/simulated/wall)) diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index 517c9efe8d6..76bdca9bb8c 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -45,7 +45,7 @@ if(--amount < 0) return - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(!T) continue diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm index 11aa6993c48..d92e11c88a5 100644 --- a/code/game/objects/effects/decals/Cleanable/fuel.dm +++ b/code/game/objects/effects/decals/Cleanable/fuel.dm @@ -33,7 +33,7 @@ if(amount < 15) return //lets suppose welder fuel is fairly thick and sticky. For something like water, 5 or less would be more appropriate. var/turf/simulated/S = loc if(!istype(S)) return - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/simulated/target = get_step(src,d) var/turf/simulated/origin = get_turf(src) if(target.Enter(src, origin)) diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index 4cce3d9f006..941f47c0f43 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -39,7 +39,7 @@ return var/placement_dir = get_dir(user, W) - if (!(placement_dir in cardinal)) + if (!(placement_dir in GLOB.cardinal)) to_chat(user, "You must stand directly in front of the wall you wish to place that on.") return @@ -49,7 +49,7 @@ stuff_on_wall = 1 //crude, but will cover most cases. We could do stuff like check pixel_x/y but it's not really worth it. - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/turf/T = get_step(W, dir) if (locate(/obj/structure/sign/poster) in T) stuff_on_wall = 1 diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 3fda70575f4..b6439a68251 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -73,9 +73,9 @@ steam.start() -- spawns the effect var/obj/effect/effect/steam/steam = new /obj/effect/effect/steam(src.location) var/direction if(src.cardinals) - direction = pick(cardinal) + direction = pick(GLOB.cardinal) else - direction = pick(alldirs) + direction = pick(GLOB.alldirs) for(i=0, i1) return var/ndir = get_dir(user, on_wall) - if (!(ndir in cardinal)) + if (!(ndir in GLOB.cardinal)) return var/turf/loc = get_turf(user) var/area/A = loc.loc diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 46661e7324a..ec95e6fedf1 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -252,7 +252,7 @@ return ROOM_ERR_TOOLARGE var/turf/T = pending[1] //why byond havent list::pop()? pending -= T - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/turf/NT = get_step(T,dir) if (!isturf(NT) || (NT in found) || (NT in pending)) continue diff --git a/code/game/objects/items/weapons/barrier_tape.dm b/code/game/objects/items/weapons/barrier_tape.dm index 40045c1f805..1bbc07f5d40 100644 --- a/code/game/objects/items/weapons/barrier_tape.dm +++ b/code/game/objects/items/weapons/barrier_tape.dm @@ -154,13 +154,13 @@ var/list/tape_roll_applications = list() // spread tape in all directions, provided there is a wall/window var/turf/T var/possible_dirs = 0 - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) T = get_step(start, dir) if(T && T.density) possible_dirs |= dir else for(var/obj/structure/window/W in T) - if(W.is_fulltile() || W.dir == reverse_dir[dir]) + if(W.is_fulltile() || W.dir == GLOB.reverse_dir[dir]) possible_dirs |= dir for(var/obj/structure/window/window in start) if(istype(window) && !window.is_fulltile()) @@ -214,12 +214,12 @@ var/list/tape_roll_applications = list() else continue else if(cur == end) - if(window.dir == reverse_dir[orientation]) + if(window.dir == GLOB.reverse_dir[orientation]) can_place = 0 break else continue - else if (window.dir == reverse_dir[orientation] || window.dir == orientation) + else if (window.dir == GLOB.reverse_dir[orientation] || window.dir == orientation) can_place = 0 break else @@ -243,21 +243,21 @@ var/list/tape_roll_applications = list() tapetest = 0 tape_dir = dir if(cur == start) - var/turf/T = get_step(start, reverse_dir[orientation]) + var/turf/T = get_step(start, GLOB.reverse_dir[orientation]) if(T && !T.density) tape_dir = orientation for(var/obj/structure/window/W in T) if(W.is_fulltile() || W.dir == orientation) tape_dir = dir for(var/obj/structure/window/window in cur) - if(istype(window) && !window.is_fulltile() && window.dir == reverse_dir[orientation]) + if(istype(window) && !window.is_fulltile() && window.dir == GLOB.reverse_dir[orientation]) tape_dir = dir else if(cur == end) var/turf/T = get_step(end, orientation) if(T && !T.density) - tape_dir = reverse_dir[orientation] + tape_dir = GLOB.reverse_dir[orientation] for(var/obj/structure/window/W in T) - if(W.is_fulltile() || W.dir == reverse_dir[orientation]) + if(W.is_fulltile() || W.dir == GLOB.reverse_dir[orientation]) tape_dir = dir for(var/obj/structure/window/window in cur) if(istype(window) && !window.is_fulltile() && window.dir == orientation) diff --git a/code/game/objects/items/weapons/duct_tape.dm b/code/game/objects/items/weapons/duct_tape.dm index 79e55302d66..3c2b7c013f0 100644 --- a/code/game/objects/items/weapons/duct_tape.dm +++ b/code/game/objects/items/weapons/duct_tape.dm @@ -200,7 +200,7 @@ var/dir_offset = 0 if(target_turf != source_turf) dir_offset = get_dir(source_turf, target_turf) - if(!(dir_offset in cardinal)) + if(!(dir_offset in GLOB.cardinal)) to_chat(user, "You cannot reach that from here.") // can only place stuck papers in cardinal directions, to return // reduce papers around corners issue. diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index 021c1518f04..50426010920 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -54,7 +54,7 @@ O.show_message("[icon2html(thing = src, target = world)] The [src.name] beeps! ") sleep(50) explosion(get_turf(src), devastate, heavy_impact, light_impact, flash_range) - for(var/dirn in cardinal) //This is to guarantee that C4 at least breaks down all immediately adjacent walls and doors. + for(var/dirn in GLOB.cardinal) //This is to guarantee that C4 at least breaks down all immediately adjacent walls and doors. var/turf/simulated/wall/T = get_step(src,dirn) if(locate(/obj/machinery/door/airlock) in T) var/obj/machinery/door/airlock/D = locate() in T diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 495304e33f3..97274276ed2 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -139,10 +139,10 @@ Frequency: for(var/obj/machinery/teleport/hub/R in machines) var/obj/machinery/computer/teleporter/com var/obj/machinery/teleport/station/station - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) station = locate(/obj/machinery/teleport/station, get_step(R, direction)) if(station) - for(direction in cardinal) + for(direction in GLOB.cardinal) com = locate(/obj/machinery/computer/teleporter, get_step(station, direction)) if(com) break diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm index e6d838703ec..72424bbe4c9 100644 --- a/code/game/objects/structures/catwalk.dm +++ b/code/game/objects/structures/catwalk.dm @@ -30,7 +30,7 @@ /obj/structure/catwalk/update_icon() var/connectdir = 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(locate(/obj/structure/catwalk, get_step(src, direction))) connectdir |= direction diff --git a/code/game/objects/structures/cliff.dm b/code/game/objects/structures/cliff.dm index 6951eefd9b0..312d1f9a112 100644 --- a/code/game/objects/structures/cliff.dm +++ b/code/game/objects/structures/cliff.dm @@ -160,14 +160,14 @@ two tiles on initialization, and which way a cliff is facing may change during m return FALSE var/turf/T = get_turf(L) - if(T && get_dir(T, loc) & reverse_dir[dir]) // dir points 'up' the cliff, e.g. cliff pointing NORTH will cause someone to fall if moving SOUTH into it. + if(T && get_dir(T, loc) & GLOB.reverse_dir[dir]) // dir points 'up' the cliff, e.g. cliff pointing NORTH will cause someone to fall if moving SOUTH into it. return TRUE return FALSE /obj/structure/cliff/proc/fall_off_cliff(mob/living/L) if(!istype(L)) return FALSE - var/turf/T = get_step(src, reverse_dir[dir]) + var/turf/T = get_step(src, GLOB.reverse_dir[dir]) var/displaced = FALSE if(dir in list(EAST, WEST)) // Apply an offset if flying sideways, to help maintain the illusion of depth. diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 24ed574ff5c..9c82946c097 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -21,14 +21,14 @@ icon = 'icons/obj/smoothlattice.dmi' icon_state = "latticeblank" updateOverlays() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/obj/structure/lattice/L if(locate(/obj/structure/lattice, get_step(src, dir))) L = locate(/obj/structure/lattice, get_step(src, dir)) L.updateOverlays() /obj/structure/lattice/Destroy() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/obj/structure/lattice/L if(locate(/obj/structure/lattice, get_step(src, dir))) L = locate(/obj/structure/lattice, get_step(src, dir)) @@ -86,7 +86,7 @@ var/dir_sum = 0 - for (var/direction in cardinal) + for (var/direction in GLOB.cardinal) if(locate(/obj/structure/lattice, get_step(src, direction))) dir_sum += direction else diff --git a/code/game/objects/structures/window_spawner.dm b/code/game/objects/structures/window_spawner.dm index 1073aa43fd0..ed7702dc201 100644 --- a/code/game/objects/structures/window_spawner.dm +++ b/code/game/objects/structures/window_spawner.dm @@ -36,7 +36,7 @@ var/obj/structure/grille/G = new /obj/structure/grille(src.loc) handle_grille_spawn(G) var/list/neighbours = list() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/turf/T = get_step(src, dir) var/obj/effect/wingrille_spawn/other = locate(/obj/effect/wingrille_spawn) in T if(!other) diff --git a/code/game/turfs/simulated/dungeon/wall.dm b/code/game/turfs/simulated/dungeon/wall.dm index e48710b81b7..362889c13a5 100644 --- a/code/game/turfs/simulated/dungeon/wall.dm +++ b/code/game/turfs/simulated/dungeon/wall.dm @@ -24,7 +24,7 @@ block_tele = TRUE /turf/simulated/wall/solidrock/update_icon() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) if(istype(T) && !T.density) var/place_dir = turn(direction, 180) @@ -44,4 +44,4 @@ return /turf/simulated/wall/solidrock/take_damage() //These things are suppose to be unbreakable - return \ No newline at end of file + return diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 2e537c8eb69..b3a150891b4 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -19,7 +19,7 @@ if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) // Must be build adjacent to an existing floor/wall, no floating floors var/list/cardinalTurfs = list() // Up a Z level - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/turf/B = get_step(T, dir) if(B) cardinalTurfs += B @@ -43,7 +43,7 @@ // Create a ceiling to shield from the weather if(src.outdoors) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/turf/A = get_step(src, dir) if(A && !A.outdoors) if(expended_tile || R.use(1)) @@ -156,4 +156,4 @@ return if(flooring) return - attackby(T, user) \ No newline at end of file + attackby(T, user) diff --git a/code/game/turfs/simulated/floor_icon.dm b/code/game/turfs/simulated/floor_icon.dm index cf5396aa967..322784d136b 100644 --- a/code/game/turfs/simulated/floor_icon.dm +++ b/code/game/turfs/simulated/floor_icon.dm @@ -34,7 +34,7 @@ var/image/no_ceiling_image = null // Apply edges, corners, and inner corners. var/has_border = 0 if(flooring.flags & TURF_HAS_EDGES) - for(var/step_dir in cardinal) + for(var/step_dir in GLOB.cardinal) var/turf/simulated/floor/T = get_step(src, step_dir) if(!istype(T) || !T.flooring || T.flooring.name != flooring.name) has_border |= step_dir diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 3edaf77ee85..b75c39c9b01 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -89,7 +89,7 @@ . = ..() if(!antilight_cache) antilight_cache = list() - for(var/diag in cornerdirs) + for(var/diag in GLOB.cornerdirs) var/image/I = image(LIGHTING_ICON, null, icon_state = "diagonals", layer = 10, dir = diag) I.plane = PLANE_LIGHTING antilight_cache["[diag]"] = I @@ -100,7 +100,7 @@ // For joined corners touching static lighting turfs, add an overlay to cancel out that part of our lighting overlay. /turf/simulated/shuttle/proc/update_breaklights() - if(join_flags in cornerdirs) // We're joined at an angle + if(join_flags in GLOB.cornerdirs) // We're joined at an angle // Dynamic lighting dissolver var/turf/T = get_step(src, turn(join_flags,180)) if(!T || !T.dynamic_lighting || !get_area(T).dynamic_lighting) diff --git a/code/game/turfs/simulated/outdoors/outdoors.dm b/code/game/turfs/simulated/outdoors/outdoors.dm index 95eea722de1..471234cbd20 100644 --- a/code/game/turfs/simulated/outdoors/outdoors.dm +++ b/code/game/turfs/simulated/outdoors/outdoors.dm @@ -52,7 +52,7 @@ var/list/turf_edge_cache = list() /turf/simulated/proc/update_icon_edge() if(edge_blending_priority && !forbid_turf_edge()) - for(var/checkdir in cardinal) + for(var/checkdir in GLOB.cardinal) var/turf/simulated/T = get_step(src, checkdir) if(istype(T) && T.edge_blending_priority && edge_blending_priority < T.edge_blending_priority && icon_state != T.icon_state && !T.forbid_turf_edge()) var/cache_key = "[T.get_edge_icon_state()]-[checkdir]" diff --git a/code/game/turfs/simulated/wall_types_vr.dm b/code/game/turfs/simulated/wall_types_vr.dm index 621ed1af123..b90cef7da54 100644 --- a/code/game/turfs/simulated/wall_types_vr.dm +++ b/code/game/turfs/simulated/wall_types_vr.dm @@ -31,7 +31,7 @@ var/list/flesh_overlay_cache = list() if(density) icon = 'icons/turf/stomach_vr.dmi' icon_state = "flesh" - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) if(istype(T) && !T.density) var/place_dir = turn(direction, 180) @@ -40,7 +40,7 @@ var/list/flesh_overlay_cache = list() add_overlay(flesh_overlay_cache["flesh_side_[place_dir]"]) if(update_neighbors) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) if(istype(get_step(src, direction), /turf/simulated/flesh)) var/turf/simulated/flesh/F = get_step(src, direction) F.update_icon() @@ -69,7 +69,7 @@ var/list/bone_overlay_cache = list() if(density) icon = 'icons/turf/wall_masks.dmi' icon_state = "bone" - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) if(istype(T) && !T.density) var/place_dir = turn(direction, 180) @@ -78,7 +78,7 @@ var/list/bone_overlay_cache = list() add_overlay(bone_overlay_cache["bone[place_dir]"]) if(update_neighbors) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) if(istype(get_step(src, direction), /turf/simulated/bone)) var/turf/simulated/bone/F = get_step(src, direction) F.update_icon() diff --git a/code/global.dm b/code/global.dm index 481bab30680..7d3457d4a08 100644 --- a/code/global.dm +++ b/code/global.dm @@ -72,17 +72,6 @@ var/list/prisonwarped = list() // List of players already warped. var/list/blobstart = list() var/list/ninjastart = list() -var/list/cardinal = list(NORTH, SOUTH, EAST, WEST) -var/list/cardinalz = list(NORTH, SOUTH, EAST, WEST, UP, DOWN) -var/list/cornerdirs = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/cornerdirsz = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTH|UP, EAST|UP, WEST|UP, SOUTH|UP, NORTH|DOWN, EAST|DOWN, WEST|DOWN, SOUTH|DOWN) -var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/reverse_dir = list( // reverse_dir[dir] = reverse of dir - 2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, - 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, - 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63 -) - var/datum/configuration_legacy/config_legacy = null var/list/combatlog = list() diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index ed55bf1ea6a..e39fa6ca14d 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -29,7 +29,7 @@ to_chat(usr, "Checking for overlapping pipes...") next_turf: for(var/turf/T in world) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0) for(var/obj/machinery/atmospherics/pipe in T) if(dir & pipe.initialize_directions) diff --git a/code/modules/admin/verbs/smite_vr.dm b/code/modules/admin/verbs/smite_vr.dm index b0d4b8aa8cf..2a1f6bbdd83 100644 --- a/code/modules/admin/verbs/smite_vr.dm +++ b/code/modules/admin/verbs/smite_vr.dm @@ -27,7 +27,7 @@ var/turf/Ts //Turf for shadekin //Try to find nondense turf - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(target,direction) if(T && !T.density) Ts = T //Found shadekin spawn turf diff --git a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm index 45a3067a1bb..695b01b9b08 100644 --- a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm +++ b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm @@ -122,7 +122,7 @@ /datum/ai_holder/simple_mob/melee/evasive/post_melee_attack(atom/A) if(holder.Adjacent(A)) - holder.IMove(get_step(holder, pick(alldirs))) + holder.IMove(get_step(holder, pick(GLOB.alldirs))) holder.face_atom(A) diff --git a/code/modules/ai/ai_holder_combat.dm b/code/modules/ai/ai_holder_combat.dm index 63154e4fe41..8c9d8332c22 100644 --- a/code/modules/ai/ai_holder_combat.dm +++ b/code/modules/ai/ai_holder_combat.dm @@ -75,7 +75,7 @@ on_engagement(target) if(firing_lanes && !test_projectile_safety(target)) // Nudge them a bit, maybe they can shoot next time. - var/turf/T = get_step(holder, pick(cardinal)) + var/turf/T = get_step(holder, pick(GLOB.cardinal)) if(T) holder.IMove(T) // IMove() will respect movement cooldown. holder.face_atom(target) @@ -282,7 +282,7 @@ /datum/ai_holder/proc/destroy_surroundings(direction, violent = TRUE) ai_log("destroy_surroundings() : Entering.", AI_LOG_TRACE) if(!direction) - direction = pick(cardinal) // FLAIL WILDLY + direction = pick(GLOB.cardinal) // FLAIL WILDLY ai_log("destroy_surroundings() : No direction given, picked [direction] randomly.", AI_LOG_DEBUG) var/turf/problem_turf = get_step(holder, direction) @@ -301,7 +301,7 @@ ai_log("destroy_surroundings() : Going to try to violently clear [problem_turf].", AI_LOG_DEBUG) // First, kill windows in the way. for(var/obj/structure/window/W in problem_turf) - if(W.dir == reverse_dir[holder.dir]) // So that windows get smashed in the right order + if(W.dir == GLOB.reverse_dir[holder.dir]) // So that windows get smashed in the right order ai_log("destroy_surroundings() : Attacking side window.", AI_LOG_INFO) return holder.IAttack(W) @@ -331,4 +331,4 @@ // Override for special behaviour. /datum/ai_holder/proc/can_violently_breakthrough() - return violent_breakthrough \ No newline at end of file + return violent_breakthrough diff --git a/code/modules/ai/ai_holder_disabled.dm b/code/modules/ai/ai_holder_disabled.dm index 48c6b6406fa..2dfed26c203 100644 --- a/code/modules/ai/ai_holder_disabled.dm +++ b/code/modules/ai/ai_holder_disabled.dm @@ -54,7 +54,7 @@ var/unsafe = FALSE tile_test: - for(var/dir_tested in cardinal) + for(var/dir_tested in GLOB.cardinal) var/turf/turf_tested = get_step(holder, dir_tested) // Look for unsafe tiles. if(!turf_tested.is_safe_to_enter(holder)) @@ -73,7 +73,7 @@ return // Just stay still. var/moving_to = 0 - moving_to = pick(cardinal) + moving_to = pick(GLOB.cardinal) var/turf/T = get_step(holder, moving_to) var/mob/living/L = locate() in T @@ -99,7 +99,7 @@ return var/moving_to = 0 // Apparently this is required or it always picks 4, according to the previous developer for simplemob AI. - moving_to = pick(cardinal) + moving_to = pick(GLOB.cardinal) holder.setDir(moving_to) holder.IMove(get_step(holder,moving_to)) wander_delay = base_wander_delay diff --git a/code/modules/ai/ai_holder_movement.dm b/code/modules/ai/ai_holder_movement.dm index 2fa12738fc0..2fe557bb0c2 100644 --- a/code/modules/ai/ai_holder_movement.dm +++ b/code/modules/ai/ai_holder_movement.dm @@ -147,7 +147,7 @@ return var/moving_to = 0 // Apparently this is required or it always picks 4, according to the previous developer for simplemob AI. - moving_to = pick(cardinal) + moving_to = pick(GLOB.cardinal) holder.setDir(moving_to) holder.IMove(get_step(holder,moving_to)) wander_delay = base_wander_delay diff --git a/code/modules/atmospherics/_atmos_setup.dm b/code/modules/atmospherics/_atmos_setup.dm index dcd4c891de9..90dbc4010f9 100644 --- a/code/modules/atmospherics/_atmos_setup.dm +++ b/code/modules/atmospherics/_atmos_setup.dm @@ -179,7 +179,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ var/cache_name = state - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D) underlays[cache_name + "[D]"] = I for(var/pipe_color in pipe_colors) @@ -211,7 +211,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ if(state == "") continue - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D) switch(state) if("intact") diff --git a/code/modules/atmospherics/components/binary_devices/algae_generator_vr.dm b/code/modules/atmospherics/components/binary_devices/algae_generator_vr.dm index 68cd5fdf641..ecb6378fe98 100644 --- a/code/modules/atmospherics/components/binary_devices/algae_generator_vr.dm +++ b/code/modules/atmospherics/components/binary_devices/algae_generator_vr.dm @@ -46,7 +46,7 @@ var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir) I.color = PIPE_COLOR_BLUE overlays += I - I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = reverse_dir[dir]) + I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = GLOB.reverse_dir[dir]) I.color = PIPE_COLOR_BLACK overlays += I @@ -181,7 +181,7 @@ data["materials"] = materials_ui data["last_flow_rate"] = last_flow_rate data["last_power_draw"] = last_power_draw - data["inputDir"] = dir2text(reverse_dir[dir]) + data["inputDir"] = dir2text(GLOB.reverse_dir[dir]) data["outputDir"] = dir2text(dir) data["usePower"] = use_power data["errorText"] = ui_error diff --git a/code/modules/atmospherics/components/omni_devices/omni_base.dm b/code/modules/atmospherics/components/omni_devices/omni_base.dm index 7ec920bdf28..eda60690d68 100644 --- a/code/modules/atmospherics/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/components/omni_devices/omni_base.dm @@ -30,7 +30,7 @@ icon_state = "base" ports = new() - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/datum/omni_port/new_port = new(src, d) switch(d) if(NORTH) diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index 46b034e2227..e05d81a2708 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -125,7 +125,7 @@ // Return the air from the turf in "front" of us (opposite the way the pipe is facing) /obj/machinery/atmospherics/unary/vent_pump/high_volume/wall_mounted/return_air() - var/turf/T = get_step(src, reverse_dir[dir]) + var/turf/T = get_step(src, GLOB.reverse_dir[dir]) if(isnull(T)) return ..() return T.return_air() diff --git a/code/modules/atmospherics/components/valve.dm b/code/modules/atmospherics/components/valve.dm index ef8600f7d79..d6e3a416710 100644 --- a/code/modules/atmospherics/components/valve.dm +++ b/code/modules/atmospherics/components/valve.dm @@ -151,7 +151,7 @@ var/node1_dir var/node2_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_directions) if (!node1_dir) node1_dir = direction diff --git a/code/modules/atmospherics/mainspipe.dm b/code/modules/atmospherics/mainspipe.dm index d0d2e3aface..732b31beed2 100644 --- a/code/modules/atmospherics/mainspipe.dm +++ b/code/modules/atmospherics/mainspipe.dm @@ -164,7 +164,7 @@ var/node1_dir var/node2_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_mains_directions) if (!node1_dir) node1_dir = direction @@ -210,7 +210,7 @@ /obj/machinery/atmospherics/mains_pipe/manifold/atmos_init() var/connect_directions = initialize_mains_directions - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) if(target.initialize_mains_directions & get_dir(target,src)) @@ -221,7 +221,7 @@ break - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) if(target.initialize_mains_directions & get_dir(target,src)) @@ -232,7 +232,7 @@ break - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) if(target.initialize_mains_directions & get_dir(target,src)) @@ -422,7 +422,7 @@ nodes.len = 1 . =..() initialize_mains_directions = dir - initialize_directions = cardinal & ~dir // actually have a normal connection too + initialize_directions = GLOB.cardinal & ~dir // actually have a normal connection too /obj/machinery/atmospherics/mains_pipe/split3/atmos_init() var/node1_dir diff --git a/code/modules/atmospherics/pipes/he_pipes.dm b/code/modules/atmospherics/pipes/he_pipes.dm index 0f8f57ad77f..63df179a9f0 100644 --- a/code/modules/atmospherics/pipes/he_pipes.dm +++ b/code/modules/atmospherics/pipes/he_pipes.dm @@ -45,7 +45,7 @@ var/node1_dir var/node2_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_directions_he) if (!node1_dir) node1_dir = direction diff --git a/code/modules/atmospherics/pipes/manifold.dm b/code/modules/atmospherics/pipes/manifold.dm index 560a66df480..373bbc7a0a4 100644 --- a/code/modules/atmospherics/pipes/manifold.dm +++ b/code/modules/atmospherics/pipes/manifold.dm @@ -115,7 +115,7 @@ /obj/machinery/atmospherics/pipe/manifold/atmos_init() var/connect_directions = (NORTH|SOUTH|EAST|WEST)&(~dir) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/target in get_step(src,direction)) if (can_be_node(target, 1)) @@ -126,7 +126,7 @@ break - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/target in get_step(src,direction)) if (can_be_node(target, 2)) @@ -137,7 +137,7 @@ break - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&connect_directions) for(var/obj/machinery/atmospherics/target in get_step(src,direction)) if (can_be_node(target, 3)) diff --git a/code/modules/atmospherics/pipes/simple.dm b/code/modules/atmospherics/pipes/simple.dm index 240f77f8a1e..3dc320dfa4d 100644 --- a/code/modules/atmospherics/pipes/simple.dm +++ b/code/modules/atmospherics/pipes/simple.dm @@ -124,7 +124,7 @@ var/node1_dir var/node2_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_directions) if (!node1_dir) node1_dir = direction diff --git a/code/modules/atmospherics/zas/Fire.dm b/code/modules/atmospherics/zas/Fire.dm index eb22d8ddcd9..b680a27ffe1 100644 --- a/code/modules/atmospherics/zas/Fire.dm +++ b/code/modules/atmospherics/zas/Fire.dm @@ -152,7 +152,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) A.fire_act(air_contents, air_contents.temperature, air_contents.volume) //spread - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/simulated/enemy_tile = get_step(my_tile, direction) if(istype(enemy_tile)) @@ -187,7 +187,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(!istype(loc, /turf)) return INITIALIZE_HINT_QDEL - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) var/datum/gas_mixture/air_contents = loc.return_air() color = fire_color(air_contents.temperature) diff --git a/code/modules/atmospherics/zas/Turf.dm b/code/modules/atmospherics/zas/Turf.dm index 9bfb4829005..f283d59c2de 100644 --- a/code/modules/atmospherics/zas/Turf.dm +++ b/code/modules/atmospherics/zas/Turf.dm @@ -58,9 +58,9 @@ var/unconnected_dirs = check_dirs #ifdef MULTIZAS - var/to_check = cornerdirsz + var/to_check = GLOB.cornerdirsz #else - var/to_check = cornerdirs + var/to_check = GLOB.cornerdirs #endif for(var/dir in to_check) @@ -68,7 +68,7 @@ if((dir & check_dirs) == dir) //check that they are connected by the corner turf var/connected_dirs = get_zone_neighbours(get_step(src, dir)) - if(connected_dirs && (dir & reverse_dir[connected_dirs]) == dir) + if(connected_dirs && (dir & GLOB.reverse_dir[connected_dirs]) == dir) unconnected_dirs &= ~dir //they are, so unflag the cardinals in question //it is safe to remove src from the zone if all cardinals are connected by corner turfs @@ -79,9 +79,9 @@ . = 0 if(istype(T) && T.zone) #ifdef MULTIZAS - var/to_check = cardinalz + var/to_check = GLOB.cardinalz #else - var/to_check = cardinal + var/to_check = GLOB.cardinal #endif for(var/dir in to_check) var/turf/simulated/other = get_step(T, dir) @@ -158,7 +158,7 @@ if(istype(unsim, /turf/simulated)) var/turf/simulated/sim = unsim - sim.open_directions |= reverse_dir[d] + sim.open_directions |= GLOB.reverse_dir[d] if(air_master.has_valid_zone(sim)) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index ce940053ff9..b1808aadb0a 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -60,7 +60,7 @@ linked = list() //clear the list var/turf/T = loc - for(var/i in alldirs) + for(var/i in GLOB.alldirs) T = get_step(loc, i) var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T if(G) @@ -177,7 +177,7 @@ linked = list() //clear the list var/turf/T = loc - for(var/i in alldirs) + for(var/i in GLOB.alldirs) T = get_step(loc, i) var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T if(G) diff --git a/code/modules/blob2/blobs/base_blob.dm b/code/modules/blob2/blobs/base_blob.dm index 1391d107728..c03ba524b6f 100644 --- a/code/modules/blob2/blobs/base_blob.dm +++ b/code/modules/blob2/blobs/base_blob.dm @@ -25,7 +25,7 @@ var/list/blobs = list() update_icon() if(!integrity) integrity = max_integrity - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) blobs += src consume_tile() @@ -129,7 +129,7 @@ var/list/blobs = list() /obj/structure/blob/proc/expand(turf/T = null, controller = null, expand_reaction = 1) if(!T) - var/list/dirs = cardinal.Copy() + var/list/dirs = GLOB.cardinal.Copy() for(var/i = 1 to 4) var/dirn = pick(dirs) dirs.Remove(dirn) diff --git a/code/modules/blob2/overmind/powers.dm b/code/modules/blob2/overmind/powers.dm index 360bfbb10b2..67429f3e8f7 100644 --- a/code/modules/blob2/overmind/powers.dm +++ b/code/modules/blob2/overmind/powers.dm @@ -180,7 +180,7 @@ /mob/observer/blob/proc/expand_blob(turf/T) var/obj/structure/blob/B = null var/turf/other_T = null - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) other_T = get_step(T, direction) if(other_T) B = locate(/obj/structure/blob) in other_T @@ -213,7 +213,7 @@ continue // Already has a blob over them. var/obj/structure/blob/B = null - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(L, direction) B = locate(/obj/structure/blob) in T if(B) diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 2efc9de6349..3301513e88b 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -1023,7 +1023,7 @@ return 0 if(malfunctioning) - direction = pick(cardinal) + direction = pick(GLOB.cardinal) // Inside an object, tell it we moved. if(isobj(wearer.loc) || ismob(wearer.loc)) diff --git a/code/modules/economy/cash_register.dm b/code/modules/economy/cash_register.dm index a814fcc4b3b..3fe6adbfd24 100644 --- a/code/modules/economy/cash_register.dm +++ b/code/modules/economy/cash_register.dm @@ -42,7 +42,7 @@ /obj/machinery/cash_register/attack_hand(mob/user as mob) // Don't be accessible from the wrong side of the machine - if(get_dir(src, user) & reverse_dir[src.dir]) return + if(get_dir(src, user) & GLOB.reverse_dir[src.dir]) return if(cash_open) if(cash_stored) diff --git a/code/modules/events/ian_storm_vr.dm b/code/modules/events/ian_storm_vr.dm index ff61810979f..92b86771d52 100644 --- a/code/modules/events/ian_storm_vr.dm +++ b/code/modules/events/ian_storm_vr.dm @@ -21,7 +21,7 @@ /datum/event/ianstorm/proc/place_ian(var/turf/T) // Try three times to place an Ian for(var/i = 0, i < 3, i++) - var/turf/target = get_step(T, pick(alldirs)) + var/turf/target = get_step(T, pick(GLOB.alldirs)) if(target && istype(target, /turf/simulated/floor)) var/mob/living/simple_mob/animal/passive/dog/corgi/Ian/doge = new(target) doge.name = "Ian " + pick("Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index 51171356f17..0a58ba7563c 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -16,7 +16,7 @@ /datum/event/meteor_wave/setup() waves = (2 + rand(1, severity)) * severity - start_side = pick(cardinal) + start_side = pick(GLOB.cardinal) endWhen = worst_case_end() /datum/event/meteor_wave/start() diff --git a/code/modules/food/kitchen/gibber.dm b/code/modules/food/kitchen/gibber.dm index 5f6e11ecb38..164bcf3304f 100644 --- a/code/modules/food/kitchen/gibber.dm +++ b/code/modules/food/kitchen/gibber.dm @@ -28,7 +28,7 @@ /obj/machinery/gibber/autogibber/LateInitialize() . = ..() - for(var/i in cardinal) + for(var/i in GLOB.cardinal) var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) ) if(input_obj) if(isturf(input_obj.loc)) diff --git a/code/modules/gamemaster/actions/meteor_defense.dm b/code/modules/gamemaster/actions/meteor_defense.dm index d0a0d40a3f7..0afa927c407 100644 --- a/code/modules/gamemaster/actions/meteor_defense.dm +++ b/code/modules/gamemaster/actions/meteor_defense.dm @@ -34,7 +34,7 @@ if(EVENT_LEVEL_MODERATE) meteor_types = meteors_catastrophic.Copy() - direction = pick(cardinal) // alldirs doesn't work with current meteor code unfortunately. + direction = pick(GLOB.cardinal) // GLOB.alldirs doesn't work with current meteor code unfortunately. waves = rand(5, 8) switch(direction) if(NORTH) @@ -63,7 +63,7 @@ while(waves) message_admins("[waves] more wave\s of meteors remain.") spawn(1) // Dir is reversed because the direction describes where meteors are going, not what side it's gonna hit. - spawn_meteors(rand(8, 12), meteors_threatening, reverse_dir[direction]) + spawn_meteors(rand(8, 12), meteors_threatening, GLOB.reverse_dir[direction]) waves-- sleep(30 SECONDS) announcement = "The station has cleared the incoming debris." diff --git a/code/modules/gamemaster/actions/surprise_meteor.dm b/code/modules/gamemaster/actions/surprise_meteor.dm index 682a8287a6d..a149916b530 100644 --- a/code/modules/gamemaster/actions/surprise_meteor.dm +++ b/code/modules/gamemaster/actions/surprise_meteor.dm @@ -13,5 +13,5 @@ /datum/gm_action/surprise_meteors/start() ..() spawn(1) - spawn_meteors(rand(4, 8), meteors_normal, pick(cardinal)) - message_admins("Surprise meteors event has ended.") \ No newline at end of file + spawn_meteors(rand(4, 8), meteors_normal, pick(GLOB.cardinal)) + message_admins("Surprise meteors event has ended.") diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 2c75e0acc0f..6fda26d7190 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -225,7 +225,7 @@ closed_turfs |= T valid_turfs |= T - for(var/dir in alldirs) + for(var/dir in GLOB.alldirs) var/turf/neighbor = get_step(T,dir) if(!neighbor || (neighbor in closed_turfs) || (neighbor in open_turfs)) continue diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 3c3002f9d92..0b83232c0b4 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -197,7 +197,7 @@ var/direction = 16 - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinal) var/turf/newTurf = get_step(T,wallDir) if(newTurf.density) direction |= wallDir diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 955abd379c3..c1597a6aa4d 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -2,7 +2,7 @@ /obj/effect/plant/proc/get_cardinal_neighbors() var/list/cardinal_neighbors = list() - for(var/check_dir in cardinal) + for(var/check_dir in GLOB.cardinal) var/turf/simulated/T = get_step(get_turf(src), check_dir) if(istype(T)) cardinal_neighbors |= T diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index d22d1b67663..413b4115d4f 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -129,7 +129,7 @@ src.visible_message("Tendrils lash out from \the [src] and drag \the [victim] in!") victim.forceMove(src.loc) buckle_mob(victim) - victim.setDir(pick(cardinal)) + victim.setDir(pick(GLOB.cardinal)) to_chat(victim, "Tendrils [pick("wind", "tangle", "tighten")] around you!") victim.Weaken(1) victim.adjustToxLoss(rand(0.5,1.25)) diff --git a/code/modules/integrated_electronics/core/assemblies/generic.dm b/code/modules/integrated_electronics/core/assemblies/generic.dm index dbd2d3fb9e2..bcc75c6c0a0 100644 --- a/code/modules/integrated_electronics/core/assemblies/generic.dm +++ b/code/modules/integrated_electronics/core/assemblies/generic.dm @@ -210,7 +210,7 @@ if(get_dist(on_wall,user) > 1) return var/ndir = get_dir(on_wall, user) - if(!(ndir in cardinal)) + if(!(ndir in GLOB.cardinal)) return var/turf/T = get_turf(user) if(!istype(T, /turf/simulated/floor)) @@ -265,4 +265,4 @@ to allow it to stick to walls." w_class = ITEMSIZE_TINY max_components = IC_COMPONENTS_BASE / 2 - max_complexity = IC_COMPLEXITY_BASE / 2 \ No newline at end of file + max_complexity = IC_COMPLEXITY_BASE / 2 diff --git a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm index de952166db8..7526d5fdd7d 100644 --- a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm @@ -20,7 +20,7 @@ write_data_to_pin(new_data) /datum/integrated_io/dir/write_data_to_pin(var/new_data) - if(isnull(new_data) || (new_data in (alldirs + list(UP, DOWN)))) + if(isnull(new_data) || (new_data in (GLOB.alldirs + list(UP, DOWN)))) data = new_data holder.on_data_written() diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm index 26e03719665..3c0f06a2229 100644 --- a/code/modules/maps/tg/reader.dm +++ b/code/modules/maps/tg/reader.dm @@ -59,7 +59,7 @@ z_offset = world.maxz + 1 // If it's not a single dir, default to north (Default orientation) - if(!(orientation in cardinal)) + if(!(orientation in GLOB.cardinal)) orientation = SOUTH var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 73056e2324c..c893652d6da 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -526,7 +526,7 @@ var/list/name_to_material return 1 // Get data for building windows here. - var/list/possible_directions = cardinal.Copy() + var/list/possible_directions = GLOB.cardinal.Copy() var/window_count = 0 for (var/obj/structure/window/check_window in user.loc) window_count++ diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index d4bf30fae7e..0b668780222 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -203,10 +203,10 @@ . = ..() // TODO - Eschew input/output machinery and just use dirs ~Leshana //Locate our output and input machinery. - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) src.input = locate(/obj/machinery/mineral/input, get_step(src, dir)) if(src.input) break - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) src.output = locate(/obj/machinery/mineral/output, get_step(src, dir)) if(src.output) break return diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index a48b0a2c644..1d373746b13 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -103,11 +103,11 @@ return INITIALIZE_HINT_LATELOAD /obj/machinery/mineral/stacking_machine/LateInitialize() - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) input = locate(/obj/machinery/mineral/input, get_step(src, dir)) if(input) break - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) output = locate(/obj/machinery/mineral/output, get_step(src, dir)) if(output) break diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm index bbe9c9444a1..d83676994d0 100644 --- a/code/modules/mining/machine_unloading.dm +++ b/code/modules/mining/machine_unloading.dm @@ -16,11 +16,11 @@ // wip - why isn't this dirs instead?! /obj/machinery/mineral/unloading_machine/LateInitialize() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) input = locate(/obj/machinery/mineral/input, get_step(src, dir)) if(input) break - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) output = locate(/obj/machinery/mineral/output, get_step(src, dir)) if(output) break diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 285f66183f3..65c3edbe2f1 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -144,7 +144,7 @@ turf/simulated/mineral/floor/light_corner if(prob(20)) overlay_detail = "asteroid[rand(0,9)]" if(random_icon) - dir = pick(alldirs) + dir = pick(GLOB.alldirs) if(mineral) if(density) MineralSpread(mapload) @@ -168,7 +168,7 @@ turf/simulated/mineral/floor/light_corner icon_state = rock_icon_state //Apply overlays if we should have borders - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) if(istype(T) && !T.density) add_overlay(get_cached_border(rock_side_icon_state,direction,icon,rock_side_icon_state)) @@ -189,7 +189,7 @@ turf/simulated/mineral/floor/light_corner add_overlay("dug_overlay") //Apply overlays if there's space - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(istype(get_step(src, direction), /turf/space) && !istype(get_step(src, direction), /turf/space/cracked_asteroid)) add_overlay(get_cached_border("asteroid_edge",direction,icon,"asteroid_edges", 0)) @@ -203,7 +203,7 @@ turf/simulated/mineral/floor/light_corner add_overlay('icons/turf/flooring/decals.dmi',overlay_detail) if(update_neighbors) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) if(istype(get_step(src, direction), /turf/simulated/mineral)) var/turf/simulated/mineral/M = get_step(src, direction) M.update_icon() @@ -271,7 +271,7 @@ turf/simulated/mineral/floor/light_corner /turf/simulated/mineral/proc/MineralSpread(mapload) UpdateMineral(!mapload) if(mineral && mineral.spread) - for(var/trydir in cardinal) + for(var/trydir in GLOB.cardinal) if(prob(mineral.spread_chance)) var/turf/simulated/mineral/target_turf = get_step(src, trydir) if(istype(target_turf) && target_turf.density && !target_turf.mineral) diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index e0fb98b299e..b76d327f54a 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -25,11 +25,11 @@ return INITIALIZE_HINT_LATELOAD /obj/machinery/mineral/mint/LateInitialize() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) input = locate(/obj/machinery/mineral/input, get_step(src, dir)) if(input) break - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) output = locate(/obj/machinery/mineral/output, get_step(src, dir)) if(output) break diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 19e8d6de5c6..3856705fdfc 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -369,7 +369,7 @@ // for(var/turf/simulated/t in oview(src,1)) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/T = get_step(src, d) if(istype(T) && !T.density) if(!LinkBlockedWithAccess(src, T, ID)) @@ -381,7 +381,7 @@ /turf/proc/TurfsWithAccess(var/obj/item/card/id/ID) var/L[] = new() - for(var/d in alldirs) + for(var/d in GLOB.alldirs) var/turf/T = get_step(src, d) if(istype(T) && !T.density) if(!LinkBlockedWithAccess(src, T, ID)) diff --git a/code/modules/mob/living/carbon/alien/diona/diona.dm b/code/modules/mob/living/carbon/alien/diona/diona.dm index ecfc6ef94d6..b29dbd2c082 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona.dm @@ -42,6 +42,6 @@ if(D.stat != CONSCIOUS) return if(prob(33) && D.canmove && isturf(D.loc) && !D.pulledby) //won't move if being pulled - step(D, pick(cardinal)) + step(D, pick(GLOB.cardinal)) if(prob(1)) D.emote(pick("scratch","jump","chirp","roll")) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index a5df6bfe9dd..c33480dce4a 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -4,7 +4,7 @@ var/obj/item/nif/deadnif = nif //Unimplant removes the reference on the mob deadnif.unimplant(src) deadnif.forceMove(drop_location()) - deadnif.throw_at(get_edge_target_turf(src,pick(alldirs)), rand(1,3), round(30/deadnif.w_class)) + deadnif.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)), rand(1,3), round(30/deadnif.w_class)) deadnif.wear(10) //Presumably it's gone through some shit if they got gibbed? if(vr_holder) @@ -20,7 +20,7 @@ for(var/obj/item/organ/I in internal_organs) I.removed() if(istype(loc,/turf)) - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),30) for(var/obj/item/organ/external/E in src.organs) E.droplimb(0,DROPLIMB_EDGE,1) @@ -29,7 +29,7 @@ for(var/obj/item/I in src) drop_from_inventory(I) - I.throw_at(get_edge_target_turf(src,pick(alldirs)), rand(1,3), round(30/I.w_class)) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)), rand(1,3), round(30/I.w_class)) ..(species.gibbed_anim) // uses the default mob.dmi file for these, so we only need to specify the first argument gibs(loc, dna, null, species.get_flesh_colour(src), species.get_blood_colour(src)) @@ -145,4 +145,4 @@ mutations.Add(SKELETON) status_flags |= DISFIGURED update_icons_body() - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 1af9b135217..845e8dceafc 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -216,7 +216,7 @@ attack_message = "[H] attempted to strike [src], but missed!" else attack_message = "[H] attempted to strike [src], but [TT.he] rolled out of the way!" - src.setDir(pick(cardinal)) + src.setDir(pick(GLOB.cardinal)) miss_type = 1 if(!miss_type && block) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 0ad219e30e3..fd1f7d1cf84 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -172,7 +172,7 @@ if(direct & WH.wind_dir) . = max(. - (WH.wind_speed / 3), -1) // Wind speedup is capped to prevent supersonic speeds from a storm. // Against it. - else if(direct & reverse_dir[WH.wind_dir]) + else if(direct & GLOB.reverse_dir[WH.wind_dir]) . += (WH.wind_speed / 3) #undef HUMAN_LOWEST_SLOWDOWN diff --git a/code/modules/mob/living/carbon/human/species/station/monkey.dm b/code/modules/mob/living/carbon/human/species/station/monkey.dm index 8fdaad15275..aa2d4c16725 100644 --- a/code/modules/mob/living/carbon/human/species/station/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/station/monkey.dm @@ -58,7 +58,7 @@ if(H.stat != CONSCIOUS) return if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled - step(H, pick(cardinal)) + step(H, pick(GLOB.cardinal)) if(prob(1)) H.emote(pick("scratch","jump","roll","tail")) diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index b375032feae..de98dab237b 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -72,7 +72,7 @@ var/global/list/sparring_attack_cache = list() else target.visible_message("[target] slams into [T]!") if(prob(50)) - target.setDir(reverse_dir[target.dir]) + target.setDir(GLOB.reverse_dir[target.dir]) target.apply_effect(attack_damage * 0.4, WEAKEN, armour) if(BP_GROIN) if(!target.isSynthetic()) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 7e66a762e62..0fbc34e5029 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -256,13 +256,13 @@ if (holding_still) holding_still = max(holding_still - 1 - hungry, 0) else if(canmove && isturf(loc) && prob(50)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) else if (holding_still) holding_still = max(holding_still - 1, 0) else if(canmove && isturf(loc) && prob(33)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) /mob/living/carbon/slime/proc/handle_AI() // the master AI process diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm index 674d69ce8b3..5e4cff9b7b1 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm @@ -172,7 +172,7 @@ else to_chat(world, "Going to move away randomly") var/turf/move_to = get_turf(L) - move_to = get_step(move_to, pick(cardinal)) + move_to = get_step(move_to, pick(GLOB.cardinal)) for(var/i = 1 to vision_range) // Move them this many steps away from where they were before. move_to = get_step_away(move_to, L, 7) if(move_to) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm index 5540679d4bf..4b89eb24a22 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/racoon.dm @@ -213,7 +213,7 @@ I.attack_hand(holder) lose_target() if(istype(A,/mob/living) && holder.Adjacent(A)) // Not the dumbest tool in the shed. If we're fighting, we're gonna dance around them. - holder.IMove(get_step(holder, pick(alldirs))) + holder.IMove(get_step(holder, pick(GLOB.alldirs))) holder.face_atom(A) request_help() // And we're going to call friends, too. diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm index 29013ad8cc6..93c60bcc230 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm @@ -380,7 +380,7 @@ //Random walk if(!moving_to) - moving_to = pick(cardinal) + moving_to = pick(GLOB.cardinal) dir = moving_to var/turf/T = get_step(src,moving_to) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index b4d08fd4350..ec0c94f4a53 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -292,7 +292,7 @@ . = mob.SelfMove(n, direct) for (var/obj/item/grab/G in mob) if (G.state == GRAB_NECK) - mob.setDir(reverse_dir[direct]) + mob.setDir(GLOB.reverse_dir[direct]) G.adjust_position() for (var/obj/item/grab/G in mob.grabbed_by) G.adjust_position() diff --git a/code/modules/multiz/pipes.dm b/code/modules/multiz/pipes.dm index c978c0e23aa..f440880807d 100644 --- a/code/modules/multiz/pipes.dm +++ b/code/modules/multiz/pipes.dm @@ -131,7 +131,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/atmos_init() normalize_dir() var/node1_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_directions) if (!node1_dir) node1_dir = direction @@ -169,7 +169,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/atmos_init() normalize_dir() var/node1_dir - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction&initialize_directions) if (!node1_dir) node1_dir = direction diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 61a966b74cf..85d0801c472 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -917,7 +917,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(!clean) // Throw limb around. if(src && istype(loc,/turf)) - throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) dir = 2 if(DROPLIMB_BURN) new /obj/effect/decal/cleanable/ash(droploc) @@ -936,19 +936,19 @@ Note that amputating the affected organ does in fact remove the infection from t gore.basecolor = use_blood_colour gore.update_icon() - gore.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + gore.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) for(var/obj/item/organ/I in internal_organs) I.removed() if(istype(loc,/turf)) - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) for(var/obj/item/I in src) if(I.w_class <= ITEMSIZE_SMALL) qdel(I) continue I.forceMove(droploc) - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) qdel(src) diff --git a/code/modules/overmap/turfs.dm b/code/modules/overmap/turfs.dm index e0653c6bef7..f539e1b9161 100644 --- a/code/modules/overmap/turfs.dm +++ b/code/modules/overmap/turfs.dm @@ -22,7 +22,7 @@ var/global/list/map_sectors = list() . = ..() // This could be done by using the using_map.overmap_size much faster, HOWEVER, doing it programatically to 'find' // the edges this way allows for 'sub overmaps' elsewhere and whatnot. - for(var/side in alldirs) // The order of this list is relevant: It should definitely break on finding a cardinal FIRST. + for(var/side in GLOB.alldirs) // The order of this list is relevant: It should definitely break on finding a cardinal FIRST. var/turf/T = get_step(src, side) if(T?.type == /turf/unsimulated/map) //Not a wall, not something else, EXACTLY a flat map turf. map_is_to_my = side diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 8e2c0f61c06..35ed768e638 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -72,7 +72,7 @@ for(var/i=(paperamount-max_paper);i>0;i--) var/obj/item/shreddedp/SP = get_shredded_paper() SP.loc = get_turf(src) - SP.throw_at(get_edge_target_turf(src,pick(alldirs)),1,5) + SP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),1,5) paperamount = max_paper update_icon() return diff --git a/code/modules/planet/frozen_planet.dm b/code/modules/planet/frozen_planet.dm index 685ffd5a480..c6ce9669b4d 100644 --- a/code/modules/planet/frozen_planet.dm +++ b/code/modules/planet/frozen_planet.dm @@ -157,7 +157,7 @@ var/datum/planet/frozen_planet/planet_frozen_planet = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(33)) @@ -189,8 +189,8 @@ var/datum/planet/frozen_planet/planet_frozen_planet = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(50)) - T.chill() \ No newline at end of file + T.chill() diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index 158bd238e27..f020e65cc44 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -220,7 +220,7 @@ var/datum/planet/sif/planet_sif = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(33)) @@ -253,7 +253,7 @@ var/datum/planet/sif/planet_sif = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(50)) diff --git a/code/modules/planet/virgo3b_vr.dm b/code/modules/planet/virgo3b_vr.dm index 3bb72441612..ec003d259f2 100644 --- a/code/modules/planet/virgo3b_vr.dm +++ b/code/modules/planet/virgo3b_vr.dm @@ -207,7 +207,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(33)) @@ -240,7 +240,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null ..() for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(50)) diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index e6120e04608..f1755ac45ee 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -115,7 +115,7 @@ wind_dir = 0 return wind_speed = new_wind_speed - wind_dir = pick(alldirs) + wind_dir = pick(GLOB.alldirs) var/message = "You feel the wind blowing [wind_speed > 2 ? "strongly ": ""]towards the [dir2text(wind_dir)]." message_all_outdoor_players(span("warning", message)) diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index 3b93f4c6a29..59239075c3f 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -1,7 +1,7 @@ //like orange but only checks north/south/east/west for one step proc/cardinalrange(var/center) var/list/things = list() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(center, direction) if(!T) continue things += T.contents @@ -51,7 +51,7 @@ proc/cardinalrange(var/center) break if(!control_unit)//No other guys nearby look for a control unit - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) for(var/obj/machinery/power/am_control_unit/AMC in cardinalrange(src)) if(AMC.add_shielding(src)) break @@ -107,7 +107,7 @@ proc/cardinalrange(var/center) /obj/machinery/am_shielding/update_icon() overlays.Cut() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/machine = locate(/obj/machinery, get_step(loc, direction)) if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit)) overlays += "shield_[direction]" @@ -139,7 +139,7 @@ proc/cardinalrange(var/center) //Scans cards for shields or the control unit and if all there it /obj/machinery/am_shielding/proc/core_check() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/machine = locate(/obj/machinery, get_step(loc, direction)) if(!machine) return 0//Need all for a core if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit)) return 0 diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 364ff409501..c6ff39ab002 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -332,7 +332,7 @@ obj/structure/cable/proc/cableColor(var/colorC) // merge with the powernets of power objects in the given direction /obj/structure/cable/proc/mergeConnectedNetworks(var/direction) - var/fdir = direction ? reverse_dir[direction] : 0 //flip the direction, to match with the source position on its turf + var/fdir = direction ? GLOB.reverse_dir[direction] : 0 //flip the direction, to match with the source position on its turf if(!(d1 == direction || d2 == direction)) //if the cable is not pointed in this direction, do nothing return @@ -412,7 +412,7 @@ obj/structure/cable/proc/cableColor(var/colorC) for(var/cable_dir in list(d1, d2)) if(cable_dir == 0) continue - var/reverse = reverse_dir[cable_dir] + var/reverse = GLOB.reverse_dir[cable_dir] T = get_zstep(src, cable_dir) if(T) for(var/obj/structure/cable/C in T) diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 0cdb1409d0e..66e72e0c753 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -41,7 +41,7 @@ GLOBAL_LIST_EMPTY(all_turbines) GLOB.all_turbines -= src return ..() -//generators connect in dir and reverse_dir(dir) directions +//generators connect in dir and GLOB.reverse_dir(dir) directions //mnemonic to determine circulator/generator directions: the cirulators orbit clockwise around the generator //so a circulator to the NORTH of the generator connects first to the EAST, then to the WEST //and a circulator to the WEST of the generator connects first to the NORTH, then to the SOUTH diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index cf9d1da2179..7f896e836e5 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -176,7 +176,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) @@ -195,7 +195,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) @@ -224,7 +224,7 @@ /proc/power_list(var/turf/T, var/source, var/d, var/unmarked=0, var/cable_only = 0) . = list() - var/reverse = d ? reverse_dir[d] : 0 + var/reverse = d ? GLOB.reverse_dir[d] : 0 for(var/AM in T) if(AM == source) continue //we don't want to return source diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 140b20ca2f0..70140178049 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -283,7 +283,7 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) if(!move_self) return 0 - var/movement_dir = pick(alldirs - last_failed_movement) + var/movement_dir = pick(GLOB.alldirs - last_failed_movement) if(force_move) movement_dir = force_move diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 6f08c19be0c..0785301f5ba 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -84,7 +84,7 @@ connect_to_network() dir_loop: - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/T = get_step(src, d) for(var/obj/machinery/power/terminal/term in T) if(term && term.dir == turn(d, 180)) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 7dc9bf28e75..1cf665f91b3 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -81,7 +81,7 @@ var/move_bias = dir var/sleep_time = FLOOR(time/move_amount, world.tick_lag) for(var/i in 0 to move_amount) - var/move_dir = pick(global.alldirs + move_bias) //ensures large-ball teslas don't just sit around + var/move_dir = pick(global.GLOB.alldirs + move_bias) //ensures large-ball teslas don't just sit around if(target && prob(10)) move_dir = get_dir(src,target) var/turf/T = get_step(src, move_dir) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index ef2d8338c7b..9cf4ca019e8 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -27,7 +27,7 @@ /obj/item/ammo_casing/proc/expend() . = BB BB = null - setDir(pick(cardinal)) //spin spent casings + setDir(pick(GLOB.cardinal)) //spin spent casings update_icon() /obj/item/ammo_casing/attackby(obj/item/W as obj, mob/user as mob) @@ -152,7 +152,7 @@ playsound(user.loc, "casing_sound", 50, 1) for(var/obj/item/ammo_casing/C in stored_ammo) C.loc = user.loc - C.setDir(pick(cardinal)) + C.setDir(pick(GLOB.cardinal)) stored_ammo.Cut() update_icon() else diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 03e8466b4ce..12d5c291f8e 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -287,7 +287,7 @@ var/armor_special = 0 if(target_armor >= 60) - var/turf/T = get_step(H, pick(alldirs - src.dir)) + var/turf/T = get_step(H, pick(GLOB.alldirs - src.dir)) H.throw_at(T, 1, 1, src) H.apply_damage(20, BURN, def_zone) if(target_limb) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index 24964bd7be2..e4fd171845a 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -246,7 +246,7 @@ /datum/reagent/lithium/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien != IS_DIONA) if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) @@ -261,7 +261,7 @@ /datum/reagent/mercury/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien != IS_DIONA) if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) M.adjustBrainLoss(0.1) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm index 11fdffc1c63..c9f06432979 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm @@ -3082,7 +3082,7 @@ End Citadel Change */ M.druggy = max(M.druggy, drug_strength) if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) /datum/reagent/ethanol/sakebomb name = "Sake Bomb" diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 05d3c7f419b..6d710425cee 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -68,7 +68,7 @@ ..() if(alien != IS_DIONA) if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) if(prob(20)) @@ -805,7 +805,7 @@ M.druggy = max(M.druggy, drug_strength) if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch", "drool", "moan", "giggle")) @@ -986,7 +986,7 @@ datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/re M.druggy = max(M.druggy, drug_strength) if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch", "drool", "moan", "giggle")) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 838a4637c81..af03a118d48 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -74,7 +74,7 @@ AM.reset_glide_size() /obj/machinery/conveyor/proc/update_dir() - if(!(dir in cardinal)) // Diagonal. Forwards is *away* from dir, curving to the right. + if(!(dir in GLOB.cardinal)) // Diagonal. Forwards is *away* from dir, curving to the right. forwards = turn(dir, 135) backwards = turn(dir, 45) else diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 34ceab151aa..44de09c58c2 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -22,7 +22,7 @@ . = ..(mapload, ) ptype = newtype dir = newdir - if(ptype == DISPOSAL_PIPE_STRAIGHT && (dir in cornerdirs)) + if(ptype == DISPOSAL_PIPE_STRAIGHT && (dir in GLOB.cornerdirs)) ptype = DISPOSAL_PIPE_CORNER switch(dir) if(NORTHWEST) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index e508990c0ac..85f4c26ed93 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -817,7 +817,7 @@ // remains : set to leave broken pipe pieces in place proc/broken(var/remains = 0) if(remains) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & dpdir) var/obj/structure/disposalpipe/broken/P = new(src.loc) P.setDir(D) @@ -1529,7 +1529,7 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) @@ -1538,6 +1538,6 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index 204c3c17730..483c12c961a 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -502,7 +502,7 @@ if(O.anchored) return 0 //mob is anchored??? if(get_dist(user, src) > 1 || get_dist(user, O) > 1) - return 0 //doesn't use adjacent() to allow for non-cardinal (fuck my life) + return 0 //doesn't use adjacent() to allow for non-GLOB.cardinal (fuck my life) if(!ishuman(user) && !isrobot(user)) return 0 //not a borg or human if(panel_open) diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm index 6d2dd75b223..eb8261cd67c 100644 --- a/code/modules/shieldgen/energy_field.dm +++ b/code/modules/shieldgen/energy_field.dm @@ -35,7 +35,7 @@ my_gen = null var/turf/current_loc = get_turf(src) . = ..() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(current_loc, direction) if(T) for(var/obj/effect/energy_field/F in T) @@ -110,7 +110,7 @@ /obj/effect/energy_field/update_icon(var/update_neightbors = 0) overlays.Cut() var/list/adjacent_shields_dir = list() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(T) // Incase we somehow stepped off the map. for(var/obj/effect/energy_field/F in T) @@ -140,7 +140,7 @@ i-- if(i) spawn(2) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(T) // Incase we somehow stepped off the map. for(var/obj/effect/energy_field/F in T) diff --git a/code/modules/shieldgen/handheld_defuser.dm b/code/modules/shieldgen/handheld_defuser.dm index 9dd953d6e94..de395d769ac 100644 --- a/code/modules/shieldgen/handheld_defuser.dm +++ b/code/modules/shieldgen/handheld_defuser.dm @@ -27,7 +27,7 @@ if(!enabled) return - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/simulated/shielded_tile = get_step(get_turf(src), direction) for(var/obj/effect/energy_field/S in shielded_tile) if(istype(S) && cell.checked_use(10 KILOWATTS * CELLRATE)) diff --git a/code/modules/shieldgen/shield_diffuser.dm b/code/modules/shieldgen/shield_diffuser.dm index ae58b5bb78f..44e96e1a5f7 100644 --- a/code/modules/shieldgen/shield_diffuser.dm +++ b/code/modules/shieldgen/shield_diffuser.dm @@ -36,7 +36,7 @@ if(!enabled) return - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/simulated/shielded_tile = get_step(get_turf(src), direction) for(var/obj/effect/energy_field/S in shielded_tile) qdel(S) diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 0ef19ce2989..e79f9d070e6 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -434,7 +434,7 @@ var/list/table_icon_cache = list() for(var/D in list(NORTH, SOUTH, EAST, WEST) - blocked_dirs) var/turf/T = get_step(src, D) for(var/obj/structure/window/W in T) - if(W.is_fulltile() || W.dir == reverse_dir[D]) + if(W.is_fulltile() || W.dir == GLOB.reverse_dir[D]) blocked_dirs |= D break else @@ -445,7 +445,7 @@ var/list/table_icon_cache = list() var/turf/T = get_step(src, D) for(var/obj/structure/window/W in T) - if(W.is_fulltile() || W.dir & reverse_dir[D]) + if(W.is_fulltile() || W.dir & GLOB.reverse_dir[D]) blocked_dirs |= D break diff --git a/code/modules/turbolift/turbolift_door.dm b/code/modules/turbolift/turbolift_door.dm index 4b83bc60cf9..916cc56e3e3 100644 --- a/code/modules/turbolift/turbolift_door.dm +++ b/code/modules/turbolift/turbolift_door.dm @@ -30,7 +30,7 @@ for(var/mob/living/LM in turf) if(LM.mob_size <= MOB_TINY) var/moved = 0 - for(dir in shuffle(cardinal.Copy())) + for(dir in shuffle(GLOB.cardinal.Copy())) var/dest = get_step(LM,dir) if(!(locate(/obj/machinery/door/airlock/lift) in dest)) if(LM.Move(dest)) @@ -43,4 +43,4 @@ audible_message("\The [src]'s motors grind as they quickly reverse direction, unable to safely close.") cur_command = null // the door will just keep trying otherwise return 0 - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 3f41567ce7b..46f0c06f569 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -194,7 +194,7 @@ pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.setDir(pick(cardinal)) + pulse2.setDir(pick(GLOB.cardinal)) spawn(10) qdel(pulse2) @@ -378,7 +378,7 @@ //if these all result in the same turf as the vehicle or nullspace, pick a new turf with open space if(!dest || dest == get_turf(src)) var/list/options = new() - for(var/test_dir in alldirs) + for(var/test_dir in GLOB.alldirs) var/new_dir = get_step_to(src, get_step(src, test_dir)) if(new_dir && load.Adjacent(new_dir)) options += new_dir diff --git a/maps/nsv_triumph/triumph_virgo3b.dm b/maps/nsv_triumph/triumph_virgo3b.dm index e8ae103ec97..607ae5a1c1c 100644 --- a/maps/nsv_triumph/triumph_virgo3b.dm +++ b/maps/nsv_triumph/triumph_virgo3b.dm @@ -238,7 +238,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(33)) @@ -281,7 +281,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(50)) @@ -388,7 +388,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null playsound(L, 'sound/effects/rustle1.ogg', 100, 1) L.drop_from_inventory(U) U.toggle_umbrella() - U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L) + U.throw_at(get_edge_target_turf(U, pick(GLOB.alldirs)), 8, 1, L) // If they have an open umbrella, it'll guard from rain if(istype(L.get_active_hand(), /obj/item/melee/umbrella)) diff --git a/maps/tether/tether_virgo3b.dm b/maps/tether/tether_virgo3b.dm index e8ae103ec97..607ae5a1c1c 100644 --- a/maps/tether/tether_virgo3b.dm +++ b/maps/tether/tether_virgo3b.dm @@ -238,7 +238,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(33)) @@ -281,7 +281,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either if(S.z in holder.our_planet.expected_z_levels) - for(var/dir_checked in cardinal) + for(var/dir_checked in GLOB.cardinal) var/turf/simulated/floor/T = get_step(S, dir_checked) if(istype(T)) if(istype(T, /turf/simulated/floor/outdoors) && prob(50)) @@ -388,7 +388,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null playsound(L, 'sound/effects/rustle1.ogg', 100, 1) L.drop_from_inventory(U) U.toggle_umbrella() - U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L) + U.throw_at(get_edge_target_turf(U, pick(GLOB.alldirs)), 8, 1, L) // If they have an open umbrella, it'll guard from rain if(istype(L.get_active_hand(), /obj/item/melee/umbrella)) diff --git a/modular_citadel/code/modules/shadekin/shadekin.dm b/modular_citadel/code/modules/shadekin/shadekin.dm index b5ee568d869..911b697c023 100644 --- a/modular_citadel/code/modules/shadekin/shadekin.dm +++ b/modular_citadel/code/modules/shadekin/shadekin.dm @@ -385,7 +385,7 @@ //Random walk if(!moving_to) - moving_to = pick(cardinal) + moving_to = pick(GLOB.cardinal) dir = moving_to var/turf/T = get_step(src,moving_to) diff --git a/tools/TagMatcher/tag-matcher.py b/tools/TagMatcher/tag-matcher.py index 0b82e05cdf2..662ecac0515 100644 --- a/tools/TagMatcher/tag-matcher.py +++ b/tools/TagMatcher/tag-matcher.py @@ -87,11 +87,11 @@ for root, subdirs, files in walk(args.dir): if filename.endswith('.dm'): file_path = path.join(root, filename) with open(file_path, 'r') as file: - mismatches_by_file[file_path] = defaultdict(list) - for line_number, line in enumerate(file, 1): - # Then for each line in the file, conduct the tuple open/close matching. - mismatches_by_tag = get_tag_matches(line) - arrange_mismatches(mismatches_by_file[file_path], line_number, mismatches_by_tag) + mismatches_by_file[file_path] = defaultdict(list) + for line_number, line in enumerate(file, 1): + # Then for each line in the file, conduct the tuple open/close matching. + mismatches_by_tag = get_tag_matches(line) + arrange_mismatches(mismatches_by_file[file_path], line_number, mismatches_by_tag) # Pretty printing section. # Loops over all matches and checks if there is a mismatch of tags.