diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index fd27385f542..f6781bbbe18 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -306,6 +306,9 @@ value_mode = VALUE_MODE_NUM splitter = "," +/datum/config_entry/number/max_law_len + config_entry_value = 1024 + /datum/config_entry/number/overflow_cap config_entry_value = -1 min_val = -1 diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 9ae32b7af37..16b63c57667 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -238,7 +238,7 @@ AI MODULES return newpos = 15 lawpos = min(newpos, 50) - var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1]) + var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len)) if(!targName) return laws[1] = targName @@ -365,7 +365,7 @@ AI MODULES var/subject = "human being" /obj/item/aiModule/core/full/asimov/attack_self(var/mob/user as mob) - var/targName = stripped_input(user, "Please enter a new subject that asimov is concerned with.", "Asimov to whom?", subject) + var/targName = stripped_input(user, "Please enter a new subject that asimov is concerned with.", "Asimov to whom?", subject, MAX_NAME_LEN) if(!targName) return subject = targName @@ -447,7 +447,7 @@ AI MODULES laws = list("") /obj/item/aiModule/core/freeformcore/attack_self(mob/user) - var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", laws[1]) + var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len)) if(!targName) return laws[1] = targName @@ -499,7 +499,7 @@ AI MODULES laws = list("") /obj/item/aiModule/syndicate/attack_self(mob/user) - var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1]) + var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len)) if(!targName) return laws[1] = targName diff --git a/config/game_options.txt b/config/game_options.txt index 46aad6c0cd1..9490062216b 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -417,6 +417,15 @@ LAW_WEIGHT buildawall,0 ## Attempting to upload laws past this point will fail unless the AI is reset SILICON_MAX_LAW_AMOUNT 12 +##------------------------------------------------ + +## SILICON LAW MAX LENGTH ### +## The maximum number of characters in a law uploaded +## Affects Freeform, Core Freeform, and Syndicate Hacked boards. +#MAX_LAW_LEN 1024 + +##------------------------------------------------ + ## Roundstart Races ##------------------------------------------------------------------------------------------- ## Uncommenting races will allow them to be choosen at roundstart while join_with_muntant_race is on. You'll need at least one.