From 97c2452decb67d2418b2117a4f1f93f14deaab13 Mon Sep 17 00:00:00 2001 From: Daniel Lenrd Date: Sun, 1 Oct 2023 22:32:35 +0900 Subject: [PATCH] Fixes AI being able to control not working APCs (#22523) * Makes destructive analyzer stay in the same menu after deconstruction * adds conditional check before toggling APC * Revert * Update and rename ai_onclick.dm to put the warning message in the right place * Rename file back to ai_onclick.dm * logic breakup Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --- code/_onclick/ai_onclick.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/_onclick/ai_onclick.dm b/code/_onclick/ai_onclick.dm index 4df67e2d2cd..c8b598ab91b 100644 --- a/code/_onclick/ai_onclick.dm +++ b/code/_onclick/ai_onclick.dm @@ -177,6 +177,12 @@ // APC /obj/machinery/power/apc/AICtrlClick(mob/living/user) // turns off/on APCs. + if(stat & BROKEN) + return + + if(aidisabled) + to_chat(user, "Unable to interface: Connection refused.") + return toggle_breaker(user)