Frame stacking fix and unit test addition. (#56287)

* Reverts #56205

* Allow things without density to bypass checks

* The rest of the owl

* The rest of the owl

* Doc and tweak

* More feex

* RCD machine frame unit test

* I suck

* AAAAA

* Bad at unit tests

* Revert unit tests (for including in another PR)

* Fix windoor_assembly return logic

* Comment /mob/living/proc/PushAM logic

* Windoor assembley logic tweak

* Fix frame stacking

* Unit test

* Better wording from macros?
This commit is contained in:
Timberpoes
2021-01-22 21:18:05 +08:00
committed by GitHub
parent 294a2518fb
commit 1989497576
17 changed files with 242 additions and 194 deletions
@@ -18,8 +18,8 @@
anchored = FALSE
density = FALSE
dir = NORTH
set_dir_on_move = FALSE
var/ini_dir
var/obj/item/electronics/airlock/electronics = null
var/created_name = null
@@ -33,7 +33,6 @@
..()
if(set_dir)
setDir(set_dir)
ini_dir = dir
air_update_turf(TRUE, TRUE)
/obj/structure/windoor_assembly/Destroy()
@@ -44,7 +43,6 @@
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
. = ..()
setDir(ini_dir)
move_update_air(T)
/obj/structure/windoor_assembly/update_icon_state()
@@ -52,18 +50,16 @@
/obj/structure/windoor_assembly/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
if(get_dir(loc, target) == dir)
return
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/structure/windoor_assembly))
var/obj/structure/windoor_assembly/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
return FALSE
var/obj/structure/window/moved_window = mover
return valid_window_location(loc, moved_window.dir, is_fulltile = moved_window.fulltile)
if(istype(mover, /obj/structure/windoor_assembly) || istype(mover, /obj/machinery/door/window))
return valid_window_location(loc, mover.dir, is_fulltile = FALSE)
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
@@ -321,13 +317,12 @@
return FALSE
var/target_dir = turn(dir, rotation_type == ROTATION_CLOCKWISE ? -90 : 90)
if(!valid_window_location(loc, target_dir))
if(!valid_window_location(loc, target_dir, is_fulltile = FALSE))
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
return TRUE
/obj/structure/windoor_assembly/proc/after_rotation(mob/user)
ini_dir = dir
update_icon()
//Flips the windoor assembly, determines whather the door opens to the left or the right