Merge pull request #8452 from Spookerton/spkrtn/fix/zap

machines don't try to electrocute ghosts
This commit is contained in:
Atermonera
2022-03-20 11:30:30 -08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -737,7 +737,7 @@ About the new airlock wires panel:
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
// The preceding comment was borrowed from the grille's shock script
/obj/machinery/door/airlock/shock(mob/user, prb)
/obj/machinery/door/airlock/shock(mob/living/user, prb)
if(!arePowerSystemsOn())
return 0
if(hasShocked)

View File

@@ -271,11 +271,13 @@ Class Procs:
state(text, "blue")
playsound(src, 'sound/machines/ping.ogg', 50, 0)
/obj/machinery/proc/shock(mob/user, prb)
/obj/machinery/proc/shock(mob/living/user, prb)
if(inoperable())
return FALSE
if(!prob(prb))
return FALSE
if (!istype(user))
return
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()