diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index b3430cb260..772c9fde0a 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -524,5 +524,9 @@ */ /datum/config_entry/flag/use_field_of_vision +//Shuttle size limiter +/datum/config_entry/number/max_shuttle_count + config_entry_value = 6 + /datum/config_entry/number/max_shuttle_size config_entry_value = 500 diff --git a/code/modules/shuttle/shuttle_creation/shuttle_creator.dm b/code/modules/shuttle/shuttle_creation/shuttle_creator.dm index e6cf6d962b..b3d99f22ab 100644 --- a/code/modules/shuttle/shuttle_creation/shuttle_creator.dm +++ b/code/modules/shuttle/shuttle_creation/shuttle_creator.dm @@ -1,4 +1,5 @@ #define SHUTTLE_CREATOR_MAX_SIZE CONFIG_GET(number/max_shuttle_size) +#define CUSTOM_SHUTTLE_LIMIT CONFIG_GET(number/max_shuttle_count) #define CARDINAL_DIRECTIONS_X list(1, 0, -1, 0) #define CARDINAL_DIRECTIONS_Y list(0, 1, 0, -1) @@ -57,6 +58,10 @@ GLOBAL_LIST_EMPTY(custom_shuttle_machines) //Machines that require updating (He ..() if(linkedShuttleId) return + if(GLOB.custom_shuttle_count > CUSTOM_SHUTTLE_LIMIT && !override_max_shuttles) + to_chat(user, "Too many shuttles have been created.") + message_admins("[ADMIN_FLW(user)] attempted to create a shuttle, however [CUSTOM_SHUTTLE_LIMIT] have already been created.") + return if(!internal_shuttle_creator) return overlay_holder.add_client(user.client) diff --git a/code/modules/shuttle/shuttle_creation/shuttle_creator_actions.dm b/code/modules/shuttle/shuttle_creation/shuttle_creator_actions.dm index d77232672b..f50b3bf59f 100644 --- a/code/modules/shuttle/shuttle_creation/shuttle_creator_actions.dm +++ b/code/modules/shuttle/shuttle_creation/shuttle_creator_actions.dm @@ -81,6 +81,9 @@ return if(shuttle_creator.linkedShuttleId) return + if(GLOB.custom_shuttle_count > CUSTOM_SHUTTLE_LIMIT) + to_chat(C, "Shuttle limit reached, sorry.") + return if(shuttle_creator.loggedTurfs.len > SHUTTLE_CREATOR_MAX_SIZE) to_chat(C, "This shuttle is too large!") return