Merge pull request #13782 from SteelSlayer/terminal-fix

Fixes incorrect APC terminal orientation
This commit is contained in:
Fox McCloud
2020-07-06 21:55:45 -04:00
committed by GitHub
+6 -10
View File
@@ -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)