diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index adf63c708d5..b2bdb8e8d97 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -214,13 +214,10 @@ emp_act var/obj/item/organ/external/affecting = get_organ(hit_zone) if(!affecting) return //should be prevented by attacked_with_item() but for sanity. - var/use_name = affecting.name - if(LAZYLEN(get_clothing_list_organ(affecting))) - use_name = affecting.limb_name - visible_message("[src] has been [LAZYPICK(I.attack_verb, "attacked")] in the [use_name] with [I] by [user]!") + visible_message("[src] has been [LAZYPICK(I.attack_verb, "attacked")] in the [affecting.name] with [I] by [user]!") - var/blocked = run_armor_check(hit_zone, "melee", I.armor_penetration, "Your armor has protected your [use_name].", "Your armor has softened the blow to your [use_name].") + var/blocked = run_armor_check(hit_zone, "melee", I.armor_penetration, "Your armor has protected your [affecting.name].", "Your armor has softened the blow to your [affecting.name].") standard_weapon_hit_effects(I, user, effective_force, blocked, hit_zone) return blocked diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index f9380e3c348..db035478335 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -94,10 +94,11 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - var/organ = affecting.name - if(LAZYLEN(target.get_clothing_list_organ(affecting))) - organ = affecting.limb_name - user.visible_message("[user] [pick(attack_verb)] [target] in the [organ]!") + + if(!affecting) + return + + user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.name]!") playsound(user.loc, attack_sound, 25, 1, -1) /datum/unarmed_attack/proc/handle_eye_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target) @@ -134,9 +135,11 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) + + if(!affecting) + return + var/organ = affecting.name - if(LAZYLEN(target.get_clothing_list_organ(affecting))) - organ = affecting.limb_name attack_damage = Clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case. @@ -208,9 +211,11 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/kick/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) + + if(!affecting) + return + var/organ = affecting.name - if(LAZYLEN(target.get_clothing_list_organ(affecting))) - organ = affecting.limb_name attack_damage = Clamp(attack_damage, 1, 5) @@ -253,9 +258,12 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/stomp/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) + + if(!affecting) + return + var/organ = affecting.name - if(LAZYLEN(target.get_clothing_list_organ(affecting))) - organ = affecting.limb_name + var/obj/item/clothing/shoes = user.shoes attack_damage = Clamp(attack_damage, 1, 5)