mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
Fixes wires breaking on shuttle movement/rotation
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user