From 295918d77c66f49745c394437fbe0bd7d1749676 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 15 Apr 2019 08:10:31 -0500 Subject: [PATCH] siiigh. tg NPC code is so bad --- .../mob/living/simple_animal/hostile/hostile.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ec858fdff5..0a8c0431bc 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -345,13 +345,14 @@ /mob/living/simple_animal/hostile/proc/AttackingTarget() in_melee = TRUE - if(isliving(target)) - var/mob/living/L = target - if(L.Adjacent(src) && vore_active && L.devourable) // aggressive check to ensure vore attacks can be made - if(prob(voracious_chance)) - vore_attack(src,L,src) - else - return L.attack_animal(src) + if(vore_active) + if(isliving(target)) + var/mob/living/L = target + if(L.Adjacent(src) && L.devourable) // aggressive check to ensure vore attacks can be made + if(prob(voracious_chance)) + vore_attack(src,L,src) + else + return L.attack_animal(src) else return target.attack_animal(src)