mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user