Moved the AI selection code to a separate proc so I can just activeais() instead of copying the whole damn pile of code.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@162 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-09-24 01:17:00 +00:00
parent 705debd161
commit 1bea183609
4 changed files with 50 additions and 46 deletions
+4 -20
View File
@@ -33,28 +33,12 @@ AI MODULES
usr << "The upload computer is broken!"
return
var/select = null
var/list/names = list()
var/list/ais = list()
var/list/namecounts = list()
for (var/mob/living/silicon/ai/A in world)
var/name = A.real_name
if (A.real_name == "Inactive AI")
continue
if (A.stat == 2)
continue
if (A.control_disabled == 1)
continue
else
names.Add(name)
namecounts[name] = 1
ais[name] = A
src.current = activeais()
if (ais.len)
select = input("Select an AI to upload laws to.", "AI selection", null, null) as null|anything in ais
src.current = ais[select]
else
if (!src.current)
usr << "No active AIs detected."
else
usr << "[src.current.name] selected for law changes."
/obj/item/weapon/aiModule/proc/install(var/obj/machinery/computer/aiupload/comp)