Skip to content

Commit

Permalink
Try that
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jan 22, 2024
1 parent fdc4e92 commit c18c41a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit c18c41a

Please sign in to comment.