Mountable frame bugfixes and minor refactor (#13076)

* initial

* bit of code cleanup / refactoring

* review changes

* CRLF to LF

* GLOB stuff

* travis did not like that

Co-authored-by: SteelSlayer <SteelSlayer@users.noreply.github.com>
This commit is contained in:
SteelSlayer
2020-06-26 01:19:27 -06:00
committed by GitHub
co-authored by SteelSlayer
parent 74d0e6523b
commit 9ea748b130
9 changed files with 57 additions and 35 deletions
+5 -6
View File
@@ -147,7 +147,7 @@
if(terminal)
terminal.connect_to_network()
/obj/machinery/power/apc/New(turf/loc, ndir, building = 0)
/obj/machinery/power/apc/New(turf/loc, direction, building = 0)
if(!armor)
armor = list("melee" = 20, "bullet" = 20, "laser" = 10, "energy" = 100, "bomb" = 30, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50)
..()
@@ -158,12 +158,11 @@
// 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(ndir)
tdir = dir // to fix Vars bug
setDir(SOUTH)
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.
pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24)
pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0
if(building)
area = get_area(src)
area.apc |= src