Fixes swarm enemies behaving like walls when dead (#17312)

* fimx..

* Scuffed swarm handling
This commit is contained in:
Guti
2025-03-11 12:43:50 +01:00
committed by GitHub
parent 12c7be16b7
commit d626f16552
3 changed files with 6 additions and 2 deletions
@@ -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 ..()
@@ -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 ..()
+4
View File
@@ -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