diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index ce906565d2..b66ebdb001 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -4,7 +4,9 @@ if(def_zone) if(isbodypart(def_zone)) - return checkarmor(def_zone, type) + var/obj/item/bodypart/bp = def_zone + if(bp.body_part) + return checkarmor(def_zone, type) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(def_zone)) return checkarmor(affecting, type) //If a specific bodypart is targetted, check how that bodypart is protected and return the value. diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index fa908db729..d041836f20 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -29,27 +29,10 @@ /proc/ran_zone(zone, probability = 80) - - zone = check_zone(zone) - if(prob(probability)) - return zone - - var/t = rand(1, 18) // randomly pick a different zone, or maybe the same one - switch(t) - if(1) - return BODY_ZONE_HEAD - if(2) - return BODY_ZONE_CHEST - if(3 to 6) - return BODY_ZONE_L_ARM - if(7 to 10) - return BODY_ZONE_R_ARM - if(11 to 14) - return BODY_ZONE_L_LEG - if(15 to 18) - return BODY_ZONE_R_LEG - + zone = check_zone(zone) + else + zone = pickweight(list(BODY_ZONE_HEAD = 6, BODY_ZONE_CHEST = 6, BODY_ZONE_L_ARM = 22, BODY_ZONE_R_ARM = 22, BODY_ZONE_L_LEG = 22, BODY_ZONE_R_LEG = 22)) return zone /proc/above_neck(zone)