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
+22
View File
@@ -512,6 +512,28 @@
/proc/format_frequency(var/f)
return "[round(f / 10)].[f % 10]"
/proc/activeais()
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
if (ais.len)
select = input("AI signals detected:", "AI selection", null, null) as null|anything in ais
return ais[select]
/proc/getmobs()
var/list/mobs = sortmobs()