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:
Fluffy
2024-10-25 19:56:02 +02:00
committed by GitHub
parent e8107c3170
commit d9c44532fc
146 changed files with 377 additions and 281 deletions
+1 -1
View File
@@ -556,7 +556,7 @@
return ..()
/obj/machinery/mining/brace/proc/connect()
for(var/angle in GLOB.cardinal) // make it face any drill in GLOB.cardinal direction from it
for(var/angle in GLOB.cardinals) // make it face any drill in GLOB.cardinals direction from it
var/obj/machinery/mining/drill/D = locate() in get_step(src, angle)
if(D)
src.dir = angle
+3 -3
View File
@@ -355,19 +355,19 @@ GLOBAL_LIST_EMPTY_TYPED(alloy_data, /datum/alloy)
. = ..()
//Locate our output and input machinery.
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/input_spot = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input_spot)
input = get_turf(input_spot) // thought of qdeling the spots here, but it's useful when rebuilding a destroyed machine
break
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/output_spot = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
output = get_turf(output_spot)
break
if(!input)
input = get_step(src, GLOB.reverse_dir[dir])
input = get_step(src, REVERSE_DIR(dir))
if(!output)
output = get_step(src, dir)
+3 -3
View File
@@ -143,19 +143,19 @@
stack_paths[stacktype] = capitalize(initial(S.name))
//Locate our output and input machinery.
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/input_spot = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input_spot)
input = get_turf(input_spot) // thought of qdeling the spots here, but it's useful when rebuilding a destroyed machine
break
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/output_spot = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
output = get_turf(output_spot)
break
if(!input)
input = get_step(src, GLOB.reverse_dir[dir])
input = get_step(src, REVERSE_DIR(dir))
if(!output)
output = get_step(src, dir)
+3 -3
View File
@@ -22,19 +22,19 @@
. = ..()
//Locate our output and input machinery.
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/input_spot = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input_spot)
input = get_turf(input_spot) // thought of qdeling the spots here, but it's useful when rebuilding a destroyed machine
break
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/output_spot = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
output = get_turf(output_spot)
break
if(!input)
input = get_step(src, GLOB.reverse_dir[dir])
input = get_step(src, REVERSE_DIR(dir))
if(!output)
output = get_step(src, dir)
+3 -3
View File
@@ -488,13 +488,13 @@
qdel(src)
return
updateOverlays()
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/obj/structure/track/R = locate(/obj/structure/track, get_step(src, dir))
if(R)
R.updateOverlays()
/obj/structure/track/Destroy()
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
var/obj/structure/track/R = locate(/obj/structure/track, get_step(src, dir))
if(R)
R.updateOverlays()
@@ -527,7 +527,7 @@
var/dir_sum = 0
for(var/direction in GLOB.cardinal)
for(var/direction in GLOB.cardinals)
if(locate(/obj/structure/track, get_step(src, direction)))
dir_sum += direction
+2 -2
View File
@@ -22,11 +22,11 @@
/obj/machinery/mineral/mint/Initialize()
. = ..()
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(src.input)
break
for(var/dir in GLOB.cardinal)
for(var/dir in GLOB.cardinals)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(src.output)
break