This commit is contained in:
SmArtKar
2020-08-17 13:32:18 +03:00
parent dd64dcc4ea
commit e087845745
3 changed files with 12 additions and 0 deletions
@@ -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
@@ -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, "<span class='warning'>Too many shuttles have been created.</span>")
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)
@@ -81,6 +81,9 @@
return
if(shuttle_creator.linkedShuttleId)
return
if(GLOB.custom_shuttle_count > CUSTOM_SHUTTLE_LIMIT)
to_chat(C, "<span class='warning'>Shuttle limit reached, sorry.</span>")
return
if(shuttle_creator.loggedTurfs.len > SHUTTLE_CREATOR_MAX_SIZE)
to_chat(C, "<span class='warning'>This shuttle is too large!</span>")
return