Skip to content

Commit 79beb27

Browse files
authored
right click locks the air alarm (#961)
1 parent 39c09fe commit 79beb27

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

code/modules/atmospherics/machinery/airalarm.dm

+15-1
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,20 @@ DEFINE_INTERACTABLE(/obj/machinery/airalarm)
907907

908908
return ..()
909909

910+
/obj/machinery/airalarm/attack_hand_secondary(mob/user, list/modifiers)
911+
. = ..()
912+
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
913+
return
914+
if(!can_interact(user))
915+
return
916+
if(!user.canUseTopic(src, USE_CLOSE|USE_SILICON_REACH) || !isturf(loc))
917+
return
918+
if(!ishuman(user))
919+
return
920+
921+
togglelock(user)
922+
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
923+
910924
/obj/machinery/airalarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
911925
if((buildstage == AIRALARM_BUILD_NO_CIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
912926
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
@@ -926,7 +940,7 @@ DEFINE_INTERACTABLE(/obj/machinery/airalarm)
926940
if(machine_stat & (NOPOWER|BROKEN))
927941
to_chat(user, span_warning("It does nothing!"))
928942
else
929-
if(src.allowed(usr) && !wires.is_cut(WIRE_IDSCAN))
943+
if(allowed(user) && !wires.is_cut(WIRE_IDSCAN))
930944
locked = !locked
931945
to_chat(user, span_notice("You [ locked ? "lock" : "unlock"] the air alarm interface."))
932946
if(!locked)

0 commit comments

Comments
 (0)