mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 23:47:16 +01:00
Merge pull request #151 from surftheseawing/doorfix
Halt autoclose when blocked too many times
This commit is contained in:
@@ -1204,9 +1204,16 @@
|
||||
return
|
||||
if(safe)
|
||||
for(var/atom/movable/M in get_turf(src))
|
||||
if (failCount > failThreshold) //something is continuously blocking the door
|
||||
do_sparks(5, TRUE, src)
|
||||
visible_message("<span class='warning'>[src]'s timing mechanism fails.</span>")
|
||||
failCount = 0
|
||||
return
|
||||
if(M.density && M != src) //something is blocking the door
|
||||
autoclose_in(60)
|
||||
failCount++
|
||||
return
|
||||
failCount = 0
|
||||
|
||||
if(forced < 2)
|
||||
if(obj_flags & EMAGGED)
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
var/poddoor = FALSE
|
||||
var/unres_sides = 0 //Unrestricted sides. A bitflag for which direction (if any) can open the door with no access
|
||||
|
||||
// GS13: Halt autoclose when blocked with static object, like a wooden barricade...
|
||||
var/failCount = 0
|
||||
var/failThreshold = 5
|
||||
|
||||
/obj/machinery/door/examine(mob/user)
|
||||
. = ..()
|
||||
if(red_alert_access)
|
||||
@@ -284,10 +288,16 @@
|
||||
return
|
||||
if(safe)
|
||||
for(var/atom/movable/M in get_turf(src))
|
||||
if (failCount > failThreshold) //something is continuously blocking the door
|
||||
do_sparks(5, TRUE, src)
|
||||
visible_message("<span class='warning'>[src]'s timing mechanism fails.</span>")
|
||||
failCount = 0
|
||||
return
|
||||
if(M.density && M != src) //something is blocking the door
|
||||
if(autoclose)
|
||||
autoclose_in(60)
|
||||
return
|
||||
failCount = 0
|
||||
|
||||
operating = TRUE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user