diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index a558dfbd084..0501caf3db1 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -132,7 +132,7 @@ var/sandbox_autoclose = 0 // close the sandbox panel after spawning an item, potentially reducing griff var/default_laws = 0 //Controls what laws the AI spawns with. - var/silicon_max_law_amount = 0 + var/silicon_max_law_amount = 12 /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index a94d9527cd2..d1d30653cac 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -28,12 +28,13 @@ AI MODULES user << "ERROR: No laws found on board." return + //Handle the lawcap if(reciever.laws) var/tot_laws = 0 - tot_laws += reciever.laws.inherent.len - tot_laws += reciever.laws.supplied.len - tot_laws += reciever.laws.ion.len - tot_laws += laws.len + for(var/lawlist in list(reciever.laws.inherent,reciever.laws.supplied,reciever.laws.ion,laws)) + for(var/mylaw in lawlist) + if(mylaw != "") + tot_laws++ if(tot_laws > config.silicon_max_law_amount && !bypass_law_amt_check)//allows certain boards to avoid this check, eg: reset user << "Not enough memory allocated to [reciever]'s law processor to handle this amount of laws." message_admins("[key_name_admin(user)] tried to upload laws to [key_name_admin(reciever)] that would exceed the law cap.")