diff --git a/code/datums/components/xeno/ai_behavior_overrides/capture_override_behavior.dm b/code/datums/components/xeno/ai_behavior_overrides/capture_override_behavior.dm index 6ddc50b7b3..b8ffc24bb7 100644 --- a/code/datums/components/xeno/ai_behavior_overrides/capture_override_behavior.dm +++ b/code/datums/components/xeno/ai_behavior_overrides/capture_override_behavior.dm @@ -70,9 +70,7 @@ var/atom/movable/target = processing_xeno.current_target if(get_dist(processing_xeno, target) <= 1) - INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, start_pulling), target) - processing_xeno.face_atom(target) - processing_xeno.swap_hand() + processing_xeno.ai_start_pulling(target) processing_xeno.ai_move_target(delta_time) return TRUE 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 736bb0f121..c1a2b07b3a 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm @@ -89,21 +89,23 @@ a_intent = INTENT_HARM + var/patrol_lenght = length(patrol_points) + if(patrol_lenght == 1) + ai_move_patrol(delta_time) + return TRUE + if(!current_target) - if(length(patrol_points)) + if(patrol_lenght) ai_move_patrol(delta_time) - else - ai_move_idle(delta_time) + return TRUE + + ai_move_idle(delta_time) return TRUE - if(GLOB.ai_capture_crit && target_distance <= 1 && ishuman(current_target)) + if(GLOB.ai_capture_crit && ishuman(current_target)) var/mob/living/carbon/human/human_target = current_target - if(human_target.stat != CONSCIOUS) - if(!pulling) - INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, start_pulling), human_target) - face_atom(human_target) - swap_hand() - + if(human_target.stat != CONSCIOUS && target_distance <= 1) + ai_start_pulling(human_target) ai_move_hive(delta_time) return TRUE @@ -442,3 +444,11 @@ if(cycled_turf.x == min_x_value) min_x_turfs += cycled_turf return min_x_turfs + +/mob/living/carbon/xenomorph/proc/ai_start_pulling(atom/movable/target) + if(pulling) + return + + INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, start_pulling), target) + face_atom(target) + swap_hand()