Fixes bugs with shuttles breaking pipes, wires and disposals

This commit is contained in:
CitadelStationBot
2017-04-24 17:43:37 -05:00
parent a6f6317b51
commit 3afe339198
9 changed files with 166 additions and 47 deletions
+10 -14
View File
@@ -1,3 +1,8 @@
// 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)
shuttleRotate(rotation)
@@ -6,25 +11,16 @@
update_parallax_contents()
return 1
// Called after all of the atoms on shuttle are moved.
/atom/movable/proc/afterShuttleMove()
return
/obj/onShuttleMove()
if(invisibility >= INVISIBILITY_ABSTRACT)
return 0
. = ..()
/obj/machinery/atmospherics/onShuttleMove()
. = ..()
for(DEVICE_TYPE_LOOP)
if(get_area(nodes[I]) != get_area(src))
nullifyNode(I)
#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
+21 -1
View File
@@ -481,6 +481,21 @@
//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)
var/turf/T0 = L0[i]
if(!T0)
@@ -502,7 +517,8 @@
//move mobile to new location
for(var/atom/movable/AM in T0)
AM.onShuttleMove(T1, rotation)
if(AM.onShuttleMove(T1, rotation))
moved_atoms += AM
if(rotation)
T1.shuttleRotate(rotation)
@@ -517,6 +533,10 @@
T0.CalculateAdjacentTurfs()
SSair.add_to_active(T0,1)
for(var/am in moved_atoms)
var/atom/movable/AM = am
AM.afterShuttleMove()
check_poddoors()
S1.last_dock_time = world.time