diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index dab5da659e..32969dd5d8 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -18,4 +18,5 @@ GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs GLOBAL_LIST_EMPTY(ai_list) GLOBAL_LIST_EMPTY(pai_list) GLOBAL_LIST_EMPTY(available_ai_shells) -GLOBAL_LIST_EMPTY(language_datums) \ No newline at end of file +GLOBAL_LIST_EMPTY(language_datums) +GLOBAL_LIST_EMPTY(simple_animals) \ No newline at end of file diff --git a/code/controllers/subsystem/npcpool.dm b/code/controllers/subsystem/npcpool.dm index 88f02b314a..d238bd2ab5 100644 --- a/code/controllers/subsystem/npcpool.dm +++ b/code/controllers/subsystem/npcpool.dm @@ -1,6 +1,7 @@ -#define PROCESSING_NPCS 0 -#define PROCESSING_DELEGATES 1 -#define PROCESSING_ASSISTANTS 2 +#define PROCESSING_SIMPLES 0 +#define PROCESSING_NPCS 1 +#define PROCESSING_DELEGATES 2 +#define PROCESSING_ASSISTANTS 3 SUBSYSTEM_DEF(npcpool) name = "NPC Pool" @@ -35,10 +36,29 @@ 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 = processing.Copy() - stage = PROCESSING_NPCS + src.currentrun = GLOB.simple_animals.Copy() + stage = PROCESSING_SIMPLES //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun + + if(stage == PROCESSING_SIMPLES) + 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.handle_automated_action() + if(SA.stat != DEAD) + SA.handle_automated_speech() + if (MC_TICK_CHECK) + return + + stage = PROCESSING_NPCS + currentrun = processing.Copy() + src.currentrun = currentrun var/list/canBeUsed = src.canBeUsed if(stage == PROCESSING_NPCS) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 8f108e6680..2e153e99c1 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -87,6 +87,7 @@ /mob/living/simple_animal/Initialize() ..() + GLOB.simple_animals += src handcrafting = new() if(gender == PLURAL) gender = pick(MALE,FEMALE) @@ -104,18 +105,6 @@ client.screen += client.void ..() -/mob/living/simple_animal/Life() - if(..()) //alive - if(!ckey) - if(stat != DEAD) - handle_automated_movement() - if(stat != DEAD) - handle_automated_action() - if(stat != DEAD) - handle_automated_speech() - if(stat != DEAD) - return 1 - /mob/living/simple_animal/updatehealth() ..() health = Clamp(health, 0, maxHealth) @@ -426,6 +415,7 @@ if(nest) nest.spawned_mobs -= src nest = null + GLOB.simple_animals -= src return ..()