Sideports a couple of init unit tests from Neb.

This commit is contained in:
MistakeNot4892
2021-02-27 13:05:16 -05:00
committed by Unknown
parent db9968a3ff
commit 3e804dc799
132 changed files with 2133 additions and 248 deletions
+6 -12
View File
@@ -11,9 +11,9 @@
layer = STAIRS_LAYER
/obj/structure/stairs/Initialize()
. = ..()
if(check_integrity())
update_icon()
return INITIALIZE_HINT_NORMAL
// Returns TRUE if the stairs are a complete and connected unit, FALSE if a piece is missing or obstructed
// Will attempt to reconnect broken pieces
@@ -70,10 +70,10 @@
var/obj/structure/stairs/middle/middle = null
/obj/structure/stairs/bottom/Initialize()
. = ..()
if(!GetAbove(src))
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
return INITIALIZE_HINT_QDEL
. = ..()
/obj/structure/stairs/bottom/Destroy()
if(top)
@@ -160,10 +160,8 @@
// If the object is pulling or grabbing anything, we'll want to move those too. A grab chain may be disrupted in doing so.
if(L.pulling && !L.pulling.anchored)
to_world("adding [L.pulling] to pulling")
pulling |= L.pulling
for(var/obj/item/weapon/grab/G in list(L.l_hand, L.r_hand))
to_world("adding [G.affecting] to pulling")
pulling |= G.affecting
// If the stairs aren't broken, go up.
@@ -182,7 +180,6 @@
// Bring the pulled/grabbed object(s) along behind us
for(var/atom/movable/P in pulling)
to_world("attempting to move [P]")
P.forceMove(get_turf(src)) // They will move onto the turf but won't get past the check earlier in crossed. Aligns animation more cleanly
switch(src.dir)
if(NORTH)
@@ -249,10 +246,10 @@
var/obj/structure/stairs/bottom/bottom = null
/obj/structure/stairs/middle/Initialize()
. = ..()
if(!GetAbove(src))
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
return INITIALIZE_HINT_QDEL
. = ..()
/obj/structure/stairs/middle/Destroy()
if(top)
@@ -332,10 +329,10 @@
var/obj/structure/stairs/bottom/bottom = null
/obj/structure/stairs/top/Initialize()
. = ..()
if(!GetBelow(src))
warning("Stair created without level below: ([loc.x], [loc.y], [loc.z])")
return INITIALIZE_HINT_QDEL
. = ..()
/obj/structure/stairs/top/Destroy()
if(middle)
@@ -422,10 +419,8 @@
// If the object is pulling or grabbing anything, we'll want to move those too. A grab chain may be disrupted in doing so.
if(L.pulling && !L.pulling.anchored)
to_world("adding [L.pulling] to pulling")
pulling |= L.pulling
for(var/obj/item/weapon/grab/G in list(L.l_hand, L.r_hand))
to_world("adding [G.affecting] to pulling")
pulling |= G.affecting
// If the stairs aren't broken, go up.
@@ -444,7 +439,6 @@
// Bring the pulled/grabbed object(s) along behind us
for(var/atom/movable/P in pulling)
to_world("attempting to move [P]")
P.forceMove(get_turf(src)) // They will move onto the turf but won't get past the check earlier in crossed. Aligns animation more cleanly
switch(src.dir)
if(NORTH)
@@ -505,7 +499,7 @@
icon_state = ""
/obj/structure/stairs/spawner/Initialize()
. = ..()
..()
var/turf/B1 = get_step(get_turf(src), turn(dir, 180))
var/turf/B2 = get_turf(src)
var/turf/T1 = GetAbove(B1)
@@ -553,4 +547,4 @@
/obj/structure/stairs/spawner/west
dir = WEST
bound_width = 64
bound_width = 64