Prevents Shocking non-living Mobs (#13422)

This commit is contained in:
Fox McCloud
2020-05-13 01:36:07 -04:00
committed by GitHub
parent 99ee9b9e55
commit 75befc7d67
2 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -289,8 +289,8 @@ 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)
if(!arePowerSystemsOn())
/obj/machinery/door/airlock/shock(mob/living/user, prb)
if(!istype(user) || !arePowerSystemsOn())
return FALSE
if(shockCooldown > world.time)
return FALSE //Already shocked someone recently?
+3 -4
View File
@@ -558,13 +558,12 @@ Class Procs:
return threatcount
/obj/machinery/proc/shock(mob/user, prb)
if(inoperable())
/obj/machinery/proc/shock(mob/living/user, prb)
if(!istype(user) || inoperable())
return FALSE
if(!prob(prb))
return FALSE
if(!isobserver(user))//if they are a ghost do not shock. Why do need cheesie honkers? You ded.
do_sparks(5, 1, src)
do_sparks(5, 1, src)
if(electrocute_mob(user, get_area(src), src, siemens_strength, TRUE))
return TRUE
return FALSE