Skip to content

Commit

Permalink
Electrified Airlock Fix
Browse files Browse the repository at this point in the history
Previously electrified airlocks had no adjacency check, only UI.
This led to remote electrocutions.
  • Loading branch information
Gatchapod authored Oct 28, 2018
1 parent 05676c1 commit 679e3be
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions code/datums/wires/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ var/const/AIRLOCK_WIRE_LIGHT = 512
/datum/wires/airlock/CanUse(mob/living/L)
var/obj/machinery/door/airlock/A = holder
if(iscarbon(L))
if(A.isElectrified())
if(A.shock(L, 100))
return 0
if(A.x - L.x <= 1 && A.x - L.x >= -1 && A.y - L.y <= 1 && A.y - L.y >= -1)
if(A.isElectrified())
if(A.shock(L, 100))
return 0
else
return 0
if(A.panel_open)
return 1
return 0
Expand Down Expand Up @@ -211,4 +214,4 @@ var/const/AIRLOCK_WIRE_LIGHT = 512
A.lights = !A.lights
A.update_icon()

..()
..()

0 comments on commit 679e3be

Please sign in to comment.