From 217dabd31ce419b68127ad5a846935579993057e Mon Sep 17 00:00:00 2001 From: Atermonera Date: Thu, 5 Mar 2020 12:13:42 -0800 Subject: [PATCH 1/2] Merge pull request #6789 from VOREStation/pol-busysignal Moving AI busy check so it's performed less and more centrally --- code/controllers/subsystems/ai.dm | 2 +- code/modules/ai/ai_holder.dm | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/code/controllers/subsystems/ai.dm b/code/controllers/subsystems/ai.dm index 89778187550..a111b83e434 100644 --- a/code/controllers/subsystems/ai.dm +++ b/code/controllers/subsystems/ai.dm @@ -25,7 +25,7 @@ SUBSYSTEM_DEF(ai) // var/mob/living/L = currentrun[currentrun.len] var/datum/ai_holder/A = currentrun[currentrun.len] --currentrun.len - if(!A || QDELETED(A)) // Doesn't exist or won't exist soon. + if(!A || QDELETED(A) || A.busy) // Doesn't exist or won't exist soon or not doing it this tick continue if(times_fired % 4 == 0 && A.holder.stat != DEAD) A.handle_strategicals() diff --git a/code/modules/ai/ai_holder.dm b/code/modules/ai/ai_holder.dm index c1638d207af..aadcdaa9e24 100644 --- a/code/modules/ai/ai_holder.dm +++ b/code/modules/ai/ai_holder.dm @@ -103,15 +103,11 @@ // 'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly. /datum/ai_holder/proc/handle_tactics() - if(busy) - return handle_special_tactic() handle_stance_tactical() // 'Strategical' processes that are more expensive on the CPU and so don't get run as often as the above proc, such as A* pathfinding or robust targeting. /datum/ai_holder/proc/handle_strategicals() - if(busy) - return handle_special_strategical() handle_stance_strategical()