From c3e161117823e6031d9c5959639dc5e9341aa338 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Fri, 16 Oct 2015 14:38:20 +0200 Subject: [PATCH 1/3] Fixes #11149 - Corrects APC behavior when hacked by malfunctioning AI. - It should now be possible to hack the APC to unlock it even when it is hacked by the AI. Normal IDs still don't work on hacked APCs. - A little side-fix, removal of malfunctioning AI's hack of an APC should now work correctly. --- code/modules/power/apc.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6a3fd1da71c..ba2bf2a7e7c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -627,6 +627,7 @@ // Malf AI, removes the APC from AI's hacked APCs list. if(hacker && hacker.hacked_apcs && src in hacker.hacked_apcs) hacker.hacked_apcs -= src + hacker = null if (opened==2) opened = 1 update_icon() @@ -862,7 +863,7 @@ user << "\The [src] have AI control disabled!" return 0 else - if ((!in_range(src, user) || !istype(src.loc, /turf) || hacker)) // AI-hacked APCs cannot be controlled by other AIs, unlinked cyborgs or humans. + if (!in_range(src, user) || !istype(src.loc, /turf)) return 0 var/mob/living/carbon/human/H = user if (istype(H)) From cbcddcad53b9bb62acdc74a3a2edb3d006b65de7 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Fri, 16 Oct 2015 14:44:01 +0200 Subject: [PATCH 2/3] Adjustment according to PsiOmegaDelta's suggestion --- code/modules/power/apc.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ba2bf2a7e7c..a1811e496c4 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -625,7 +625,7 @@ qdel(W) stat &= ~BROKEN // Malf AI, removes the APC from AI's hacked APCs list. - if(hacker && hacker.hacked_apcs && src in hacker.hacked_apcs) + if(hacker && hacker.hacked_apcs && (src in hacker.hacked_apcs)) hacker.hacked_apcs -= src hacker = null if (opened==2) From e33ae21f75f3180c165e0d668b84255ef9427f19 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Mon, 30 Nov 2015 23:19:04 +0100 Subject: [PATCH 3/3] Adjusts APC emag behavior - Mostly under-the-hood changes. - Emagged APCs may now have their panel removed with screwdriver, so you can access wires - Emagged APCs no longer rely on locked var, instead they check for emagged var as mwerezak suggested. --- code/modules/power/apc.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index a1811e496c4..7f232d80412 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -479,8 +479,6 @@ user << "There is nothing to secure." return update_icon() - else if(emagged) - user << "The interface is broken." else wiresexposed = !wiresexposed user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" @@ -750,7 +748,7 @@ return var/list/data = list( - "locked" = locked, + "locked" = (locked && !emagged) ? 1 : 0, "isOperating" = operating, "externalPower" = main_status, "powerCellStatus" = cell ? cell.percent() : null, @@ -882,7 +880,7 @@ if(!can_use(usr, 1)) return 1 - if(!istype(usr, /mob/living/silicon) && locked) + if(!istype(usr, /mob/living/silicon) && (locked && !emagged)) // Shouldn't happen, this is here to prevent href exploits usr << "You must unlock the panel to use this!" return 1