Fixes melee attacks using area effect armour values

def_zone is normally not set when attacking with a melee weapon, and the
melee armour check didn't use target_zone for some reason.
This commit is contained in:
mwerezak
2014-07-15 01:30:32 -04:00
parent 4448784402
commit fd6181c54f

View File

@@ -189,7 +189,8 @@ emp_act
/mob/living/carbon/human/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone)
if(!I || !user) return 0
var/target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, src)
var/target_zone = def_zone? def_zone : get_zone_with_miss_chance(user.zone_sel.selecting, src)
if(user == src) // Attacking yourself can't miss
target_zone = user.zone_sel.selecting
if(!target_zone)
@@ -228,7 +229,7 @@ emp_act
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].")
var/weapon_sharp = is_sharp(I)
var/weapon_edge = has_edge(I)
if ((weapon_sharp || weapon_edge) && prob(getarmor(def_zone, "melee")))
if ((weapon_sharp || weapon_edge) && prob(getarmor(target_zone, "melee")))
weapon_sharp = 0
weapon_edge = 0