diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index 453539ff1c3f..1ef89999eea6 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -13,6 +13,7 @@ if(isturf(target) && tile_attack) //Attacks on turfs must be done indirectly through directional attacks or clicking own sprite. var/turf/T = target + var/mob/living/non_xeno_target for(var/mob/living/L in T) if (!iscarbon(L)) if (!alt) @@ -21,13 +22,19 @@ if (!L.is_xeno_grabbable() || L == src) //Xenos never attack themselves. continue + var/isxeno = isxeno(L) + if(!isxeno) + non_xeno_target = L if (L.body_position == LYING_DOWN) alt = L continue + else if (!isxeno) + break target = L - break if (target == T && alt) target = alt + if(non_xeno_target) + target = non_xeno_target if (T && ignores_resin) // Will not target resin walls and doors if this is set to true. This is normally only set to true through a directional attack. if(istype(T, /obj/structure/mineral_door/resin)) var/obj/structure/mineral_door/resin/attacked_door = T