mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
Adds a max length config option for AI law upload boards. (#42700)
* Adds a length check for freeforms, 250 char cap * added a define as requested. * Actually it's better if it applies to all boards * Now it's better good Also added a max to the Asimov board that was missing it before. * Better defined * Undefining defines * Config code * Adding config line * whoops * Update AI_modules.dm
This commit is contained in:
@@ -306,6 +306,9 @@
|
|||||||
value_mode = VALUE_MODE_NUM
|
value_mode = VALUE_MODE_NUM
|
||||||
splitter = ","
|
splitter = ","
|
||||||
|
|
||||||
|
/datum/config_entry/number/max_law_len
|
||||||
|
config_entry_value = 1024
|
||||||
|
|
||||||
/datum/config_entry/number/overflow_cap
|
/datum/config_entry/number/overflow_cap
|
||||||
config_entry_value = -1
|
config_entry_value = -1
|
||||||
min_val = -1
|
min_val = -1
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ AI MODULES
|
|||||||
return
|
return
|
||||||
newpos = 15
|
newpos = 15
|
||||||
lawpos = min(newpos, 50)
|
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)
|
if(!targName)
|
||||||
return
|
return
|
||||||
laws[1] = targName
|
laws[1] = targName
|
||||||
@@ -365,7 +365,7 @@ AI MODULES
|
|||||||
var/subject = "human being"
|
var/subject = "human being"
|
||||||
|
|
||||||
/obj/item/aiModule/core/full/asimov/attack_self(var/mob/user as mob)
|
/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)
|
if(!targName)
|
||||||
return
|
return
|
||||||
subject = targName
|
subject = targName
|
||||||
@@ -447,7 +447,7 @@ AI MODULES
|
|||||||
laws = list("")
|
laws = list("")
|
||||||
|
|
||||||
/obj/item/aiModule/core/freeformcore/attack_self(mob/user)
|
/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)
|
if(!targName)
|
||||||
return
|
return
|
||||||
laws[1] = targName
|
laws[1] = targName
|
||||||
@@ -499,7 +499,7 @@ AI MODULES
|
|||||||
laws = list("")
|
laws = list("")
|
||||||
|
|
||||||
/obj/item/aiModule/syndicate/attack_self(mob/user)
|
/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)
|
if(!targName)
|
||||||
return
|
return
|
||||||
laws[1] = targName
|
laws[1] = targName
|
||||||
|
|||||||
@@ -417,6 +417,15 @@ LAW_WEIGHT buildawall,0
|
|||||||
## Attempting to upload laws past this point will fail unless the AI is reset
|
## Attempting to upload laws past this point will fail unless the AI is reset
|
||||||
SILICON_MAX_LAW_AMOUNT 12
|
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
|
## 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.
|
## Uncommenting races will allow them to be choosen at roundstart while join_with_muntant_race is on. You'll need at least one.
|
||||||
|
|||||||
Reference in New Issue
Block a user