mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Cutting an airlock's ID wire prevents ID usage again (#96195)
This commit is contained in:
@@ -322,6 +322,10 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/allowed(mob/accessor)
|
||||
return ..() || emergency
|
||||
|
||||
/// A mob is trying to open or close the door
|
||||
/obj/machinery/door/proc/try_to_activate_door(mob/user, access_bypass = FALSE, bumped = FALSE)
|
||||
add_fingerprint(user)
|
||||
if(operating || (obj_flags & EMAGGED))
|
||||
@@ -333,24 +337,8 @@
|
||||
if(elevator_mode && elevator_status != LIFT_PLATFORM_UNLOCKED)
|
||||
return
|
||||
|
||||
var/access_check = access_bypass
|
||||
if(emergency)
|
||||
access_check = TRUE
|
||||
else if(unrestricted_side(user) && !delayed_unres_open)
|
||||
access_check = TRUE
|
||||
else if(!requiresID())
|
||||
access_check = TRUE
|
||||
else if(allowed(user)) // You
|
||||
access_check = TRUE
|
||||
else for(var/mob/living/human_backpack in user.buckled_mobs)
|
||||
if(allowed(human_backpack)) // Your partner in crime
|
||||
access_check = TRUE
|
||||
break
|
||||
|
||||
if(!access_check && unrestricted_side(user) && attempt_delayed_unres_open(user))
|
||||
access_check = TRUE
|
||||
|
||||
if(access_check)
|
||||
// note: if the ID wire is cut no ID cards are checked at all! (This is intentional!)
|
||||
if(access_bypass || (requiresID() && user_can_activate_door(user)))
|
||||
if(density)
|
||||
open()
|
||||
else
|
||||
@@ -360,6 +348,18 @@
|
||||
else if(!operating && density)
|
||||
run_animation(DOOR_DENY_ANIMATION)
|
||||
|
||||
/// Used in try_to_activate_door
|
||||
/obj/machinery/door/proc/user_can_activate_door(mob/user)
|
||||
PRIVATE_PROC(TRUE)
|
||||
if(allowed(user))
|
||||
return TRUE
|
||||
for(var/mob/living/human_backpack in user.buckled_mobs)
|
||||
if(allowed(human_backpack))
|
||||
return TRUE
|
||||
if(unrestricted_side(user))
|
||||
return !delayed_unres_open || attempt_delayed_unres_open(user)
|
||||
return FALSE
|
||||
|
||||
/// Allows for specific side of airlocks to be unrestricted (IE, can exit maint freely, but need access to enter)
|
||||
/obj/machinery/door/proc/unrestricted_side(mob/opener)
|
||||
return get_dir(src, opener) & unres_sides
|
||||
|
||||
Reference in New Issue
Block a user