mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
Merge pull request #11949 from PsiOmegaDelta/160109-AI
Creates a new process for handling AI code.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
var/list/datum/list_of_ais = list()
|
||||
|
||||
/datum/controller/process/ai/setup()
|
||||
name = "ai"
|
||||
schedule_interval = 2 SECONDS
|
||||
start_delay = 17
|
||||
|
||||
/datum/controller/process/ai/doWork()
|
||||
for(last_object in list_of_ais)
|
||||
var/datum/ai/AI = last_object
|
||||
if(isnull(AI.gcDestroyed) && istype(AI))
|
||||
try
|
||||
if(AI.process() == PROCESS_KILL)
|
||||
list_of_ais -= AI
|
||||
catch(var/exception/e)
|
||||
catchException(e, AI)
|
||||
SCHECK
|
||||
else
|
||||
catchBadType(AI)
|
||||
list_of_ais -= AI
|
||||
|
||||
/datum/controller/process/ai/statProcess()
|
||||
..()
|
||||
stat(null, "[list_of_ais.len] AI\s")
|
||||
Reference in New Issue
Block a user