Merge pull request #34727 from ShizCalev/simpleanimal-godmode
Stops simple_animals from attacking mobs in godmode
This commit is contained in:
@@ -170,6 +170,11 @@
|
||||
if(isturf(the_target) || !the_target || the_target.type == /atom/movable/lighting_object) // bail out on invalids
|
||||
return FALSE
|
||||
|
||||
if(ismob(the_target)) //Target is in godmode, ignore it.
|
||||
var/mob/M = the_target
|
||||
if(M.status_flags & GODMODE)
|
||||
return FALSE
|
||||
|
||||
if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it
|
||||
return FALSE
|
||||
if(search_objects < 2)
|
||||
|
||||
@@ -315,16 +315,20 @@
|
||||
|
||||
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
|
||||
if(see_invisible < the_target.invisibility)
|
||||
return 0
|
||||
return FALSE
|
||||
if(ismob(the_target))
|
||||
var/mob/M = the_target
|
||||
if(M.status_flags & GODMODE)
|
||||
return FALSE
|
||||
if (isliving(the_target))
|
||||
var/mob/living/L = the_target
|
||||
if(L.stat != CONSCIOUS)
|
||||
return 0
|
||||
return FALSE
|
||||
if (ismecha(the_target))
|
||||
var/obj/mecha/M = the_target
|
||||
if (M.occupant)
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/simple_animal/handle_fire()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user