From 443fa7c3ff54a74ee1bfd2ac9e5fb48c4867147e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 18 Sep 2020 05:15:29 +0200 Subject: [PATCH] [MIRROR] Return on place shuttle rotating. No more shuttle crashing on rotating. and one tile shifting. (#859) * Fix shuttles being destroyed if piloted too close to where they already were (#53631) Return on place shuttle rotating. No more shuttle crashing on rotating. and one tile shifting. Shuttles no more able move stationary docking ports. Reverts #53133 Shuttle hulk fix. fixes #47764 fixes #45853 Add destroying of custom dock on shuttle_docker Destroy. * Return on place shuttle rotating. No more shuttle crashing on rotating. and one tile shifting. Co-authored-by: Dennok --- code/modules/shuttle/navigation_computer.dm | 12 ++++++++++-- code/modules/shuttle/on_move.dm | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index be7f94b3335..56227630894 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -36,6 +36,14 @@ . = ..() GLOB.navigation_computers -= src + if(my_port && my_port.get_docked()) + my_port.delete_after = TRUE + my_port.id = null + my_port.name = "Old [my_port.name]" + my_port = null + else + QDEL_NULL(my_port) + /obj/machinery/computer/camera_advanced/shuttle_docker/attack_hand(mob/user) if(jammed) to_chat(user, "The Syndicate is jamming the console!") @@ -227,9 +235,9 @@ // Too close to the map edge is never allowed if(!T || T.x <= 10 || T.y <= 10 || T.x >= world.maxx - 10 || T.y >= world.maxy - 10) return SHUTTLE_DOCKER_BLOCKED - /* // If it's one of our shuttle areas assume it's ok to be there + // If it's one of our shuttle areas assume it's ok to be there if(shuttle_port.shuttle_areas[T.loc]) - return SHUTTLE_DOCKER_LANDING_CLEAR */ + return SHUTTLE_DOCKER_LANDING_CLEAR . = SHUTTLE_DOCKER_LANDING_CLEAR // See if the turf is hidden from us var/list/hidden_turf_info diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index 924f9fd3e23..a55c153ab82 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -371,10 +371,24 @@ All ShuttleMove procs go here if(moving_dock == src) . |= MOVE_CONTENTS -/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) +// Never move the stationary docking port, otherwise things get WEIRD +/obj/docking_port/stationary/onShuttleMove() + return FALSE + +// Special movable stationary port, for your mothership shenanigans +/obj/docking_port/stationary/movable/onShuttleMove(turf/newT, turf/oldT, 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 - . = ..() + + if(newT == oldT) // In case of in place shuttle rotation shenanigans. + return + + if(loc != oldT) // This is for multi tile objects + return + + loc = newT + + return TRUE /obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, 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.