From 5397e798c65bf58ff33fd5a3d9535e1f44e5fc95 Mon Sep 17 00:00:00 2001 From: Mykhailo Bykhovtsev Date: Fri, 1 Jun 2018 10:51:31 -0700 Subject: [PATCH] Hostile AI fix (#4839) When I made an update to hostile AI, I have not seen this stupid bug. This one variable makes them ignore people with full health. I urge to merge it ASAP as carps and spiders won't attack people with 100 health. fixes #4836 Also this makes hostile mobs to destroy surroundings if there is no-one to attack. --- code/modules/mob/living/simple_animal/hostile/hostile.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 21bce1f0d1b..10dcac507f3 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -33,7 +33,7 @@ return null var/atom/T = null - var/lowest_health = 100 + var/lowest_health = INFINITY // Max you can get stop_automated_movement = 0 for(var/atom/A in targets) @@ -192,6 +192,8 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH if(HOSTILE_STANCE_IDLE) targets = ListTargets(10) target_mob = FindTarget() + if(isnull(target_mob)) + DestroySurroundings() if(HOSTILE_STANCE_ATTACK) if(destroy_surroundings)