From c18c41af3ac956cbf2fb6db24939d2b6f1f46b40 Mon Sep 17 00:00:00 2001 From: morrow Date: Mon, 22 Jan 2024 14:02:42 -0500 Subject: [PATCH] Try that --- code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm index 57c27a68c2..3392050f01 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm @@ -25,6 +25,9 @@ /// The actual cooldown declaration for forceful retargeting, reference forced_retarget_time for time in between checks COOLDOWN_DECLARE(forced_retarget_cooldown) + /// Amount of times no path found has occured + var/no_path_found_amount = 0 + /// The time interval between calculating new paths if we cannot find a path var/no_path_found_period = (2.5 SECONDS) @@ -169,10 +172,15 @@ return FALSE if(no_path_found) - COOLDOWN_START(src, no_path_found_cooldown, no_path_found_period) + + if(no_path_found_amount > 0) + COOLDOWN_START(src, no_path_found_cooldown, no_path_found_period) no_path_found = FALSE + no_path_found_amount++ return FALSE + no_path_found_amount = 0 + if((!current_path || (next_path_generation < world.time && current_target_turf != T)) && COOLDOWN_FINISHED(src, no_path_found_cooldown)) if(!XENO_CALCULATING_PATH(src) || current_target_turf != T) SSxeno_pathfinding.calculate_path(src, T, max_range, src, CALLBACK(src, PROC_REF(set_path)), list(src, current_target))