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()