diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 1b1002cd502d..dd9d533a24bc 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -67,17 +67,15 @@ var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest var/dtype = BRUTE var/volume = I.get_volume_by_throwforce_and_or_w_class() - if(istype(I, /obj/item)) //If the item is a weapon... - var/obj/item/W = I - dtype = W.damtype + dtype = I.damtype - if (W.throwforce > 0) //If the weapon's throwforce is greater than zero... - if (W.throwhitsound) //...and throwhitsound is defined... - playsound(loc, W.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound. - else if(W.hitsound) //Otherwise, if the weapon's hitsound is defined... - playsound(loc, W.hitsound, volume, 1, -1) //...play the weapon's hitsound. - else if(!W.throwhitsound) //Otherwise, if throwhitsound isn't defined... - playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg. + if (I.throwforce > 0) //If the weapon's throwforce is greater than zero... + if (I.throwhitsound) //...and throwhitsound is defined... + playsound(loc, I.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound. + else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined... + playsound(loc, I.hitsound, volume, 1, -1) //...play the weapon's hitsound. + else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined... + playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg. else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero... playsound(loc, 'sound/weapons/genhit.ogg', volume, 1, -1)//...play genhit.ogg