mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Refactored directionals (#20082)
Refactored directionals, ported lists of directions from TG, got rid of useless proc to get the reverse direction.
This commit is contained in:
@@ -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 GLOB.cardinal)
|
||||
for(var/direction in GLOB.cardinals)
|
||||
var/turf/T = get_step(center, direction)
|
||||
if(!T)
|
||||
continue
|
||||
@@ -138,7 +138,7 @@
|
||||
coredirs |= direction
|
||||
|
||||
// Detect cores, shielding, and control boxen.
|
||||
if(direction in GLOB.cardinal)
|
||||
if(direction in GLOB.cardinals)
|
||||
if(istype(machine, /obj/machinery/am_shielding))
|
||||
var/obj/machinery/am_shielding/AMS = machine
|
||||
if(AMS.control_unit == control_unit)
|
||||
|
||||
@@ -397,7 +397,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
for(var/cable_dir in list(d1, d2))
|
||||
if(cable_dir == 11 || cable_dir == 12 || cable_dir == 0)
|
||||
continue
|
||||
var/reverse = GLOB.reverse_dir[cable_dir]
|
||||
var/reverse = REVERSE_DIR(cable_dir)
|
||||
T = get_step(src, cable_dir)
|
||||
if(T)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in GLOB.cardinal)
|
||||
for(var/card in GLOB.cardinals)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in GLOB.cardinal)
|
||||
for(var/card in GLOB.cardinals)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
connect_to_network()
|
||||
|
||||
dir_loop:
|
||||
for(var/d in GLOB.cardinal)
|
||||
for(var/d in GLOB.cardinals)
|
||||
var/turf/T = get_step(src, d)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(d, 180))
|
||||
@@ -314,7 +314,7 @@
|
||||
tempDir = EAST
|
||||
if (NORTHWEST, SOUTHWEST)
|
||||
tempDir = WEST
|
||||
var/turf/tempLoc = get_step(src, reverse_direction(tempDir))
|
||||
var/turf/tempLoc = get_step(src, REVERSE_DIR(tempDir))
|
||||
if (istype(tempLoc, /turf/space))
|
||||
to_chat(user, SPAN_WARNING("You can't build a terminal on space."))
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user