Stasis Cages - Bugfixes & QoL (#22982)

changes:
- qol: "Mobs in animal traps can now be transferred directly to Stasis
Cages by click-dragging rather than requiring them to be in a net."
- bugfix: "Mobs can no longer use their ranged attacks while contained
inside objects (including animal traps)."
- bugfix: "Stasis cages now apply stasis only while powered and
correctly clear it when releasing simplemobs."
- bugfix: "Fixes stasis cage transfers race condition freeing trapped
animals randomly."
  - bugfix: "Corrects stasis cage safety-wire status display."
This commit is contained in:
Batrachophreno
2026-08-02 01:41:17 +00:00
committed by GitHub
parent d2e5fbca75
commit 1658eda825
5 changed files with 47 additions and 8 deletions
@@ -69,7 +69,10 @@
return ..()
/obj/structure/machinery/stasis_cage/process(seconds_per_tick)
if (use_power || !cell || !cell.charge)
if (!use_power || !cell || !cell.charge)
if (isanimal(contained))
var/mob/living/simple_animal/SA = contained
SA.in_stasis = FALSE
return
cell.use(2 * seconds_per_tick)
if (contained)
@@ -100,7 +103,10 @@
release()
/obj/structure/machinery/stasis_cage/proc/release()
if (contained)
if(contained)
if(isanimal(contained))
var/mob/living/simple_animal/SA = contained
SA.in_stasis = FALSE
contained.dropInto(src)
contained = null
playsound(get_turf(src), 'sound/machines/airlock.ogg', 40)
@@ -249,6 +255,12 @@
playsound(src, 'sound/machines/AirlockClose.ogg', 100)
add_fingerprint(user)
if (do_after(user, 2 SECONDS, src))
if(QDELETED(target) || contained || broken || !use_power)
return
if(target.buckled_to)
target.buckled_to.unbuckle()
if(istype(target.buckled_to, /obj/item/trap/animal))
var/obj/item/trap/animal/animal_trap = target.buckled_to
animal_trap.release(transferring = TRUE)
else
target.buckled_to.unbuckle()
contain(user, target)