This commit is contained in:
LetterJay
2017-10-19 09:01:55 -05:00
71 changed files with 595 additions and 309 deletions
+34
View File
@@ -0,0 +1,34 @@
SUBSYSTEM_DEF(idlenpcpool)
name = "Idling NPC Pool"
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
priority = 10
wait = 60
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
/datum/controller/subsystem/idlenpcpool/stat_entry()
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
..("IdleNPCS:[idlelist.len]")
/datum/controller/subsystem/idlenpcpool/fire(resumed = FALSE)
if (!resumed)
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
src.currentrun = idlelist.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
--currentrun.len
if(!SA.ckey)
if(SA.stat != DEAD)
SA.handle_automated_movement()
if(SA.stat != DEAD)
SA.consider_wakeup()
if (MC_TICK_CHECK)
return
+2 -1
View File
@@ -37,7 +37,8 @@ SUBSYSTEM_DEF(npcpool)
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
if (!resumed)
src.currentrun = GLOB.simple_animals.Copy()
var/list/activelist = GLOB.simple_animals[AI_ON]
src.currentrun = activelist.Copy()
stage = PROCESSING_SIMPLES
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun