From f2f2f349ca1119a3fe17a824d1a757c3c9417e03 Mon Sep 17 00:00:00 2001 From: Cruix Date: Mon, 16 Oct 2017 23:01:01 -0500 Subject: [PATCH 1/2] Fixed the shuttle navigation computer allowing you to move docking ports (#31721) * Fixed the shuttle navigation computer allowing you to move stationary docking ports * Moved a var from stationary docking ports to mobile docking ports * Removed a sanity check --- code/modules/shuttle/navigation_computer.dm | 2 +- code/modules/shuttle/on_move.dm | 19 +++++++++---------- code/modules/shuttle/shuttle.dm | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 61bfe3a2b5..d376fda48a 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -80,7 +80,7 @@ return FALSE var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj if(!my_port) - my_port = new /obj/docking_port/stationary + my_port = new /obj/docking_port/stationary() my_port.name = shuttlePortName my_port.id = shuttlePortId var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index ad2f44f534..9a593bc7bc 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -74,7 +74,7 @@ All ShuttleMove procs go here return move_mode // Called on atoms to move the atom to the new location -/atom/movable/proc/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/atom/movable/proc/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) if(newT == oldT) // In case of in place shuttle rotation shenanigans. return @@ -266,7 +266,7 @@ All ShuttleMove procs go here /************************************Mob move procs************************************/ -/mob/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/mob/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) if(!move_on_shuttle) return . = ..() @@ -291,7 +291,7 @@ All ShuttleMove procs go here if(movement_force["KNOCKDOWN"]) Knockdown(movement_force["KNOCKDOWN"]) -/mob/living/simple_animal/hostile/megafauna/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/mob/living/simple_animal/hostile/megafauna/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) . = ..() message_admins("Megafauna [src] [ADMIN_FLW(src)] moved via shuttle from [ADMIN_COORDJMP(oldT)] to [ADMIN_COORDJMP(loc)]") @@ -322,21 +322,20 @@ All ShuttleMove procs go here /************************************Misc move procs************************************/ -/atom/movable/lighting_object/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/atom/movable/lighting_object/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) return FALSE -/atom/movable/light/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/atom/movable/light/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) return FALSE -/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) - if(old_dock == src) //Don't move the dock we're leaving +/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) + if(!moving_dock.can_move_docking_ports || (old_dock == src)) return FALSE - . = ..() -/obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) id = "mining_public" //It will not move with the base, but will become enabled as a docking point. -/obj/effect/abstract/proximity_checker/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/obj/effect/abstract/proximity_checker/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) //timer so it only happens once addtimer(CALLBACK(monitor, /datum/proximity_monitor/proc/SetRange, monitor.current_range, TRUE), 0, TIMER_UNIQUE) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 5b55d4672d..8e181d90b1 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -283,6 +283,7 @@ var/engine_coeff = 1 //current engine coeff var/current_engines = 0 //current engine power var/initial_engines = 0 //initial engine power + var/can_move_docking_ports = FALSE //if this shuttle can move docking ports other than the one it is docked at /obj/docking_port/mobile/proc/register() SSshuttle.mobile += src @@ -599,7 +600,7 @@ var/atom/movable/moving_atom = thing if(moving_atom.loc != oldT) //fix for multi-tile objects continue - moving_atom.onShuttleMove(newT, oldT, rotation, movement_force, movement_direction, old_dock)//atoms + moving_atom.onShuttleMove(newT, oldT, rotation, movement_force, movement_direction, old_dock, src)//atoms moved_atoms += moving_atom if(move_mode & MOVE_TURF) oldT.onShuttleMove(newT, underlying_turf_type, underlying_baseturf_type, rotation, movement_force, movement_direction)//turfs