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
|
if(isturf(the_target) || !the_target || the_target.type == /atom/movable/lighting_object) // bail out on invalids
|
||||||
return FALSE
|
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
|
if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it
|
||||||
return FALSE
|
return FALSE
|
||||||
if(search_objects < 2)
|
if(search_objects < 2)
|
||||||
|
|||||||
@@ -315,16 +315,20 @@
|
|||||||
|
|
||||||
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
|
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
|
||||||
if(see_invisible < the_target.invisibility)
|
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))
|
if (isliving(the_target))
|
||||||
var/mob/living/L = the_target
|
var/mob/living/L = the_target
|
||||||
if(L.stat != CONSCIOUS)
|
if(L.stat != CONSCIOUS)
|
||||||
return 0
|
return FALSE
|
||||||
if (ismecha(the_target))
|
if (ismecha(the_target))
|
||||||
var/obj/mecha/M = the_target
|
var/obj/mecha/M = the_target
|
||||||
if (M.occupant)
|
if (M.occupant)
|
||||||
return 0
|
return FALSE
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
/mob/living/simple_animal/handle_fire()
|
/mob/living/simple_animal/handle_fire()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user