From c5e09ab0acce58cddfe79169987349bdb7d99cf8 Mon Sep 17 00:00:00 2001 From: Dennok Date: Sat, 3 Aug 2019 05:48:00 +0300 Subject: [PATCH] Keep occupied custom dock (#45407) About The Pull Request Shuttles no more ruin areas on fly off from moved custom dock. If you dock to custom dock, then move custom dock, after fly off shuttle turfs lost its areas, it replaced by space. It ok in space, but bad on lavaland. Why It's Good For The Game Gravityless and airless areas on lavalend is bad. Changelog cl fix: Shuttles no more ruin areas on fly off from moved custom dock. /cl --- code/modules/shuttle/navigation_computer.dm | 7 +++++++ code/modules/shuttle/shuttle.dm | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 68e2e58dd59..70a1457c8be 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -135,6 +135,13 @@ to_chat(current_user, "Unknown object detected in landing zone. Please designate another location.") return + ///Make one use port that deleted after fly off, to don't lose info that need on to properly fly off. + 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 + if(!my_port) my_port = new() my_port.name = shuttlePortName diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 02df514908e..5be23f5a9d0 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -23,6 +23,8 @@ var/area_type var/hidden = FALSE //are we invisible to shuttle navigation computers? + var/delete_after = FALSE ///Delete this port after ship fly off. + //these objects are indestructible /obj/docking_port/Destroy(force) // unless you assert that you know what you're doing. Horrible things @@ -432,7 +434,10 @@ if(initiate_docking(S1) != DOCKING_SUCCESS) WARNING("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"].") else - previous = S0 + if(S0.delete_after) + qdel(S0, TRUE) + else + previous = S0 else WARNING("shuttle \"[id]\" could not enter transit space. S0=[S0 ? S0.id : "null"] S1=[S1 ? S1.id : "null"]")