Fixes USB ports/cables erroneously detaching when shuttles move (#91043)

## About The Pull Request

When a shuttle moves, usb ports now wait for the shuttle to finish
moving all of its contents to determine whether they should detach from
whatever they are connected to.

This PR also adds a new signal whose registered handlers can affect what
gets moved when part of a shuttle moves, but until a handler for that
signal actually needs to do so, that behavior only really matters in the
sense that it is now exposed to lua scripting.
This commit is contained in:
Y0SH1M4S73R
2025-05-16 21:49:57 -05:00
committed by GitHub
parent f332633932
commit 80ec197457
4 changed files with 85 additions and 34 deletions
@@ -99,7 +99,8 @@ All ShuttleMove procs go here
// returns the new move_mode (based on the old)
// WARNING: Do not leave turf contents in beforeShuttleMove or dock() will runtime
/atom/movable/proc/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock)
return move_mode
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(src, COMSIG_ATOM_BEFORE_SHUTTLE_MOVE, newT, rotation, move_mode, moving_dock) || move_mode
/// Called on atoms to move the atom to the new location
/atom/movable/proc/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
@@ -115,6 +116,7 @@ All ShuttleMove procs go here
// Called on atoms after everything has been moved
/atom/movable/proc/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ATOM_AFTER_SHUTTLE_MOVE, oldT)
if(light)
update_light()