From 4305d1daea151e860b4767960e7e52089fb0170a Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Mon, 6 Jul 2020 18:29:29 -0500 Subject: [PATCH] Fixes incorrect APC terminal orientation --- code/modules/power/apc.dm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index f613f34a8fd..56e38d31935 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -70,7 +70,6 @@ var/locked = 1 var/coverlocked = 1 var/aidisabled = 0 - var/tdir = null var/obj/machinery/power/terminal/terminal = null var/lastused_light = 0 var/lastused_equip = 0 @@ -155,15 +154,12 @@ GLOB.apcs = sortAtom(GLOB.apcs) wires = new(src) - // offset 24 pixels in direction of dir - // this allows the APC to be embedded in a wall, yet still inside an area - if(building) - setDir(direction) // We set this to direction only for pixel location determination. - - set_pixel_offsets_from_dir(24, -24, 24, -24) // Set pixel offsets based on `dir` - setDir(SOUTH) // APC's should always appear to *face* south. if(building) + // Offset 24 pixels in direction of dir. This allows the APC to be embedded in a wall, yet still inside an area + setDir(direction) // This is only used for pixel offsets, and later terminal placement. APC dir doesn't affect its sprite since it only has one orientation. + set_pixel_offsets_from_dir(24, -24, 24, -24) + area = get_area(src) area.apc |= src opened = 1 @@ -193,8 +189,8 @@ /obj/machinery/power/apc/proc/make_terminal() // create a terminal object at the same position as original turf loc // wires will attach to this - terminal = new/obj/machinery/power/terminal(src.loc) - terminal.setDir(tdir) + terminal = new/obj/machinery/power/terminal(get_turf(src)) + terminal.setDir(dir) terminal.master = src /obj/machinery/power/apc/Initialize(mapload)