From d626f16552eb2d13877049493abda6199b33d9ec Mon Sep 17 00:00:00 2001 From: Guti <32563288+TheCaramelion@users.noreply.github.com> Date: Tue, 11 Mar 2025 12:43:50 +0100 Subject: [PATCH] Fixes swarm enemies behaving like walls when dead (#17312) * fimx.. * Scuffed swarm handling --- .../simple_mob/subtypes/animal/giant_spider/_giant_spider.dm | 2 +- .../mob/living/simple_mob/subtypes/animal/space/carp.dm | 2 +- code/modules/projectiles/projectile.dm | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/_giant_spider.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/_giant_spider.dm index 4e72596d6c1..3634d540e15 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/_giant_spider.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/_giant_spider.dm @@ -125,7 +125,7 @@ AddComponent(/datum/component/swarming) /mob/living/simple_mob/animal/giant_spider/CanPass(atom/movable/mover, turf/target) - if(isliving(mover) && !istype(mover, /mob/living/simple_mob/animal/giant_spider) && mover.density == TRUE) + if(isliving(mover) && !istype(mover, /mob/living/simple_mob/animal/giant_spider) && mover.density == TRUE && stat != DEAD) return FALSE return ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm index ef40595c1c2..f8e59c6c9e2 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm @@ -95,7 +95,7 @@ // This is so carps can swarm /mob/living/simple_mob/animal/space/carp/CanPass(atom/movable/mover, turf/target) - if(isliving(mover) && !istype(mover, /mob/living/simple_mob/animal/space/carp) && mover.density == TRUE) + if(isliving(mover) && !istype(mover, /mob/living/simple_mob/animal/space/carp) && mover.density == TRUE && stat != DEAD) return FALSE return ..() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 2bd59698f61..e35ca22695c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -554,6 +554,10 @@ else var/mob/living/L = target if(!direct_target) + // Swarms are special scuffed critters. They must have density FALSE to swarm, but then they don't get hit. + // So we'll check before, just in case. Lying might gives a chance to dodge, however. + if(L.GetComponent(/datum/component/swarming) && L.stat != DEAD && !L.lying) + return TRUE if(!L.density) return FALSE return TRUE