Fixes doubled attack calls on simple animals

These weren't actually causing double damage, but were doubling sounds
and attack logs

Butchering was refactored into a separate proc for convenience
This commit is contained in:
Krausus
2016-07-19 22:40:56 -04:00
parent 96d3967a60
commit 44938178ce
3 changed files with 13 additions and 8 deletions
+9
View File
@@ -837,6 +837,15 @@
/mob/living/proc/get_permeability_protection()
return 0
/mob/living/proc/attempt_harvest(obj/item/I, mob/user)
if(stat == DEAD && !isnull(butcher_results)) //can we butcher it?
if(istype(I, /obj/item/weapon/kitchen/knife))
to_chat(user, "<span class='notice'>You begin to butcher [src]...</span>")
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
if(do_mob(user, src, 80))
harvest(user)
return 1
/mob/living/proc/harvest(mob/living/user)
if(qdeleted(src))
return
@@ -434,6 +434,8 @@
return
else
user.changeNext_move(CLICK_CD_MELEE)
if(attempt_harvest(O, user))
return
user.do_attack_animation(src)
if(istype(O) && istype(user) && !O.attack(src, user))
var/damage = 0
@@ -451,7 +453,6 @@
user.visible_message("<span class='warning'>[user] gently taps [src] with [O].</span>",\
"<span class='warning'>This weapon is ineffective, it does no damage.</span>")
adjustBruteLoss(damage)
..()
/mob/living/simple_animal/movement_delay()