Fixes wires breaking on shuttle movement/rotation

This commit is contained in:
c0
2017-04-21 11:20:00 +03:00
parent 7db57a9f25
commit 3b0b963609
4 changed files with 77 additions and 16 deletions
+4 -9
View File
@@ -1,3 +1,7 @@
// Called before shuttle starts moving atoms.
/atom/movable/proc/beforeShuttleMove(turf/T1, rotation)
return
// Called when shuttle attempts to move an atom.
/atom/movable/proc/onShuttleMove(turf/T1, rotation)
if(rotation)
@@ -18,15 +22,6 @@
. = ..()
#define DIR_CHECK_TURF_AREA(X) (get_area(get_ranged_target_turf(src, X, 1)) != A)
/obj/structure/cable/onShuttleMove()
. = ..()
var/A = get_area(src)
//cut cables on the edge
if(DIR_CHECK_TURF_AREA(NORTH) || DIR_CHECK_TURF_AREA(SOUTH) || DIR_CHECK_TURF_AREA(EAST) || DIR_CHECK_TURF_AREA(WEST))
cut_cable_from_powernet()
#undef DIR_CHECK_TURF_AREA
/atom/movable/light/onShuttleMove()
return 0
+13
View File
@@ -481,6 +481,19 @@
//move or squish anything in the way ship at destination
roadkill(L0, L1, S1.dir)
for(var/i in 1 to L0.len)
var/turf/T0 = L0[i]
if(!T0)
continue
var/turf/T1 = L1[i]
if(!T1)
continue
if(T0.type == T0.baseturf)
continue
for(var/atom/movable/AM in T0)
AM.beforeShuttleMove(T1, rotation)
var/list/moved_atoms = list()
for(var/i in 1 to L0.len)