From 48833342fcc2a3863552dc95b859a4852cac00f9 Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Tue, 9 Dec 2025 17:17:18 -0500 Subject: [PATCH] Fixes fire alarms going off when not detecting and keycards (#18875) * Fixes #18874 Fixes fire alarms going off when not detecting if fire is on the turf * Fixes keycard authenticators from giving infinite frames Fixes #18873 --- code/game/machinery/fire_alarm.dm | 2 +- .../kitchen/cooking_machines/_appliance.dm | 8 +-- .../security levels/keycard authentication.dm | 50 ++++++++++--------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index e9ff22dc68c..bf115bfee3b 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -150,7 +150,7 @@ FIRE ALARM updateDialog() last_process = world.timeofday - if(locate(/obj/fire) in src.loc) + if(detecting && (locate(/obj/fire) in loc)) alarm() return diff --git a/code/modules/food/kitchen/cooking_machines/_appliance.dm b/code/modules/food/kitchen/cooking_machines/_appliance.dm index e5ed3a8d73b..1dc06365079 100644 --- a/code/modules/food/kitchen/cooking_machines/_appliance.dm +++ b/code/modules/food/kitchen/cooking_machines/_appliance.dm @@ -655,9 +655,11 @@ smoke.start() // Set off fire alarms! - var/obj/machinery/firealarm/FA = locate() in get_area(src) - if(FA) - FA.alarm() + var/area/area_to_check = get_area(src) + for(var/obj/machinery/firealarm/FA in area_to_check.get_contents()) + if(FA && FA.detecting) + FA.alarm() + break /obj/machinery/appliance/attack_hand(var/mob/user) if(..()) diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 36f27670c57..821c6386d6f 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -23,13 +23,39 @@ power_channel = ENVIRON /obj/machinery/keycard_auth/attack_ai(mob/user) - to_chat (user, span_warning("A firewall prevents you from interfacing with this device!")) + to_chat(user, span_warning("A firewall prevents you from interfacing with this device!")) return /obj/machinery/keycard_auth/attackby(obj/item/W, mob/user) + if(W.has_tool_quality(TOOL_SCREWDRIVER)) + to_chat(user, "You begin removing the faceplate from the [src]") + playsound(src, W.usesound, 50, 1) + if(do_after(user, 1 SECOND * W.toolspeed, target = src)) + to_chat(user, "You remove the faceplate from the [src]") + var/obj/structure/frame/A = new /obj/structure/frame(loc) + A.circuit = circuit + A.frame_type = circuit.board_type + circuit = null + A.need_circuit = FALSE + A.pixel_x = pixel_x + A.pixel_y = pixel_y + A.set_dir(dir) + A.anchored = TRUE + for(var/obj/C in src) + if(istype(C, /obj/item/circuitboard)) + C.forceMove(A) + continue + C.forceMove(loc) + A.forensic_data = forensic_data //carry crime data over. + A.state = FRAME_WIRED + A.update_icon() + qdel(src) + return + if(stat & (NOPOWER|BROKEN)) to_chat(user, "This device is not powered.") return + if(istype(W,/obj/item/card/id)) var/obj/item/card/id/ID = W if(ACCESS_KEYCARD_AUTH in ID.GetAccess()) @@ -42,28 +68,6 @@ event_triggered_by = user broadcast_request(user) //This is the device making the initial event request. It needs to broadcast to other devices - if(W.has_tool_quality(TOOL_SCREWDRIVER)) - to_chat(user, "You begin removing the faceplate from the [src]") - playsound(src, W.usesound, 50, 1) - if(do_after(user, 1 SECOND * W.toolspeed, target = src)) - to_chat(user, "You remove the faceplate from the [src]") - var/obj/structure/frame/A = new /obj/structure/frame(loc) - var/obj/item/circuitboard/M = new circuit(A) - A.frame_type = M.board_type - A.need_circuit = 0 - A.pixel_x = pixel_x - A.pixel_y = pixel_y - A.set_dir(dir) - A.circuit = M - A.anchored = TRUE - for (var/obj/C in src) - C.forceMove(loc) - A.state = 3 - A.update_icon() - M.deconstruct(src) - qdel(src) - return - /obj/machinery/keycard_auth/power_change() ..() if(stat &NOPOWER)