diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index f1774d355f4..ffdde0fb938 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -116,11 +116,7 @@ return 1 if(isliving(the_target)) var/mob/living/L = the_target - var/faction_check = 0 - for(var/F in faction) - if(F in L.faction) - faction_check = 1 - break + var/faction_check = faction_check(L) if(robust_searching) if(L.stat > stat_attack || L.stat != stat_attack && stat_exclusive == 1) return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 6a5397ad05c..b80dc417ad7 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -87,7 +87,7 @@ if(grasping.len < max_grasps) for(var/mob/living/L in range(grasp_range,src)) - if(L == src) + if(L == src || faction_check(L)) continue if(!(L in grasping) && L != target && prob(grasp_chance)) L << "\the [src] has you entangled!" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 82362afc3c1..3ece8a53fa3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -976,3 +976,9 @@ var/next_mob_id = 0 //Can the mob use Topic to interact with machines /mob/proc/canUseTopic() return + +/mob/proc/faction_check(mob/target) + for(var/F in faction) + if(F in target.faction) + return 1 + return 0 \ No newline at end of file