mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 09:34:21 +01:00
Keeps bumped windoors open if someone stands in front of them (#19019)
* Makes windoors stay open if someone's standing in front of them * Windoor is now held open when you're on the same turf * I guess we do want to check the mob instead of the floor * Adds access control to propping open windoors * Ensure we check both people for access
This commit is contained in:
@@ -72,10 +72,19 @@
|
||||
|
||||
/obj/machinery/door/window/proc/open_and_close()
|
||||
open()
|
||||
if(check_access(null))
|
||||
sleep(50)
|
||||
else //secure doors close faster
|
||||
sleep(20)
|
||||
addtimer(CALLBACK(src, .proc/check_close), check_access(null) ? 5 SECONDS : 2 SECONDS)
|
||||
|
||||
|
||||
/// Check whether or not this door can close, based on whether or not someone's standing in front of it holding it open
|
||||
/obj/machinery/door/window/proc/check_close()
|
||||
var/mob/living/blocker = locate(/mob/living) in get_turf(get_step(src, dir)) // check the facing turf
|
||||
if(!blocker || blocker.stat || !allowed(blocker))
|
||||
blocker = locate(/mob/living) in get_turf(src)
|
||||
if(blocker && !blocker.stat && allowed(blocker))
|
||||
// kick the can down the road, someone's holding the door.
|
||||
addtimer(CALLBACK(src, .proc/check_close), check_access(null) ? 5 SECONDS : 2 SECONDS)
|
||||
return
|
||||
|
||||
close()
|
||||
|
||||
/obj/machinery/door/window/Bumped(atom/movable/AM)
|
||||
|
||||
Reference in New Issue
Block a user