From 84c03a38299c442e1a8f92ca46d005fdb96ac2f4 Mon Sep 17 00:00:00 2001 From: Sawu Date: Sun, 28 Feb 2016 12:31:04 +1100 Subject: [PATCH] * Makes limb check typeless * Filtered types now use is_type_in_list() * Properly fixes a health runtime due to target juggling --- code/modules/mob/interactive.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm index 8bcaea4e01a..deee74b96f2 100644 --- a/code/modules/mob/interactive.dm +++ b/code/modules/mob/interactive.dm @@ -160,8 +160,9 @@ var/obj/item/organ/limb/head/L = locate(/obj/item/organ/limb/head) in organs qdel(L) organs += new /obj/item/organ/limb/robot/head - for(var/obj/item/organ/limb/LIMB in organs) - LIMB.owner = src + for(var/LIMB in organs) + var/obj/item/organ/limb/L = LIMB + L.owner = src update_icons() update_damage_overlays(0) update_augments() @@ -551,9 +552,10 @@ return pick(/area/hallway,/area/crew_quarters) /mob/living/carbon/human/interactive/proc/target_filter(target) + var/list/filtered_targets = list(/area, /turf, /obj/machinery/door, /atom/movable/light, /obj/structure/cable, /obj/machinery/atmospherics) var/list/L = target for(var/atom/A in target) // added a bunch of "junk" that clogs up the general find procs - if(istype(A,/area) || istype(A,/turf) || istype(A,/obj/machinery/door) || istype(A,/atom/movable/light) || istype(A,/obj/structure/cable) || istype(A,/obj/machinery/atmospherics)) + if(is_type_in_list(A,filtered_targets)) L -= A return L @@ -763,7 +765,7 @@ if(Adjacent(TARGET)) M.attack_hand(src) timeout++ - else if(timeout >= 10 || M.health <= 1 || !(targetRange(M) > 14)) + else if(timeout >= 10 || !(targetRange(M) > 14)) doing = doing & ~FIGHTING timeout = 0 TARGET = null