Vampire bats no longer attack their owner, fixes hostiles not attacking spacepods

This commit is contained in:
Markolie
2015-08-09 18:22:24 +02:00
parent a522d0a86f
commit b471406faa
3 changed files with 17 additions and 0 deletions
@@ -56,6 +56,11 @@
if(istype(A) && A == owner)
return 0
return ..()
/mob/living/simple_animal/hostile/scarybat/CanAttack(var/atom/the_target)//This is here as a potential override to pick a specific target if available
if(istype(the_target) && the_target == owner)
return 0
return ..()
/mob/living/simple_animal/hostile/scarybat/AttackingTarget()
. =..()
@@ -72,6 +72,9 @@
for(var/obj/mecha/M in mechas_list)
if(get_dist(M, src) <= vision_range && can_see(src, M, vision_range))
L += M
for(var/obj/spacepod/S in spacepods_list)
if(get_dist(S, src) <= vision_range && can_see(src, S, vision_range))
L += S
else
var/list/Objects = oview(vision_range, src)
L += Objects
@@ -117,6 +120,11 @@
if(M.occupant)//Just so we don't attack empty mechs
if(CanAttack(M.occupant))
return 1
if(istype(the_target, /obj/spacepod))
var/obj/spacepod/S = the_target
if(S.occupant || S.occupant2)//Just so we don't attack empty mechs
if(CanAttack(S.occupant) || CanAttack(S.occupant2))
return 1
if(isliving(the_target))
var/mob/living/L = the_target
var/faction_check = 0
@@ -490,6 +490,10 @@
var/obj/mecha/M = the_target
if (M.occupant)
return 0
if (istype(target,/obj/spacepod))
var/obj/spacepod/S = target
if (S.occupant || S.occupant2)
return 0
return 1
/mob/living/simple_animal/update_fire()