From c6d0eced94df734677daf9cd4eace1e6543f6513 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Thu, 6 Jun 2024 15:29:59 -0400 Subject: [PATCH] fix: better handling of whiteship signaller input (#25531) --- code/modules/shuttle/dock_generator.dm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/code/modules/shuttle/dock_generator.dm b/code/modules/shuttle/dock_generator.dm index ab53133315b..86ac963c464 100644 --- a/code/modules/shuttle/dock_generator.dm +++ b/code/modules/shuttle/dock_generator.dm @@ -37,6 +37,7 @@ var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST) var/dir_choice = tgui_input_list(user, "Select the new docking area orientation.", "Dock Orientation", dir_choices) if(!dir_choice) + to_chat(user, "Docking placement cancelled.") return var/dest_dir = dir_choices[dir_choice] @@ -76,17 +77,22 @@ qdel(port, force = TRUE) return - placed_docks += port - var/dock_count = length(placed_docks) - - var/basename = "Custom Dock #[dock_count]" + var/basename = "Docking Port #[length(placed_docks) + 1]" var/name = tgui_input_text(user, message = "Select the new docking area name.", title = "New Dock Name", default = basename, max_length = 20 ) - port.name = name ? name : basename + if(!name) + to_chat(user, "Docking placement cancelled.") + qdel(port, force = TRUE) + return + + placed_docks += port + var/dock_count = length(placed_docks) + + port.name = name port.id = "whiteship_custom_[dock_count]" port.register()