From e087845745e958a2acc76f0397c8e3c1b07fc28a Mon Sep 17 00:00:00 2001 From: SmArtKar Date: Mon, 17 Aug 2020 13:32:18 +0300 Subject: [PATCH] reee --- code/controllers/configuration/entries/game_options.dm | 4 ++++ code/modules/shuttle/shuttle_creation/shuttle_creator.dm | 5 +++++ .../shuttle/shuttle_creation/shuttle_creator_actions.dm | 3 +++ 3 files changed, 12 insertions(+) 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