Prevents a runtime when something other than a player mob breaks an airlock (#95418)

## About The Pull Request

adds an `isliving()` check in airlock's `shock()`. Wires generally call
`[object].shock(usr, ...)`. The `shocking` argument is `isliving()`ed in
the base `shock()`, but airlocks need it checked before that.
Unfortunate that it must be checked twice in quick succession, but I can
think of no less wasteful way.

## Why It's Good For The Game

closes #95385

## Changelog
🆑

code: fixed a runtime when something other than a player breaks an
airlock

/🆑
This commit is contained in:
Leland Kemble
2026-03-17 17:37:39 -04:00
committed by GitHub
parent 2e382b0423
commit 7a65b60d79
+2
View File
@@ -486,6 +486,8 @@
/obj/machinery/door/airlock/shock(mob/living/shocking, chance, shock_source, siemens_coeff)
if(!hasPower()) // unpowered, no shock
return FALSE
if(!isliving(shocking))
return FALSE
if(HAS_TRAIT(shocking, TRAIT_AIRLOCK_SHOCKIMMUNE)) // Be a bit more clever man come on
return FALSE
if(!COOLDOWN_FINISHED(src, shockCooldown))