From cbbf831bc756f17cd75b388dd9100a653b602ce1 Mon Sep 17 00:00:00 2001 From: Odairu <39929315+Odairu@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:22:28 -0500 Subject: [PATCH] Adds checks to make sure that both the AI and Modsuit wearer are present and in character to allow for mind swap + 1 bug fix (#2700) ## About The Pull Request Title + fixes a bug where cryoing as the suit ai as the original wearer of the modsuit would then cause the original AI to be stuck in limbo when deactivating the suit ## Why It's Good For The Game bugs ## Proof Of Testing ![image](https://github.com/user-attachments/assets/c932a2e2-4530-45cd-b21c-e375375aa9b9)
Screenshots/Videos
## Changelog :cl: fix: AIs can no long control a host body and themself at the same time fix: if the original wearer becomes the AI and cryo's, the original AI will no longer be stuck in limbo /:cl: --- modular_zubbers/code/modules/mod/modules.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modular_zubbers/code/modules/mod/modules.dm b/modular_zubbers/code/modules/mod/modules.dm index 6b158b28753..6165f5d8a87 100644 --- a/modular_zubbers/code/modules/mod/modules.dm +++ b/modular_zubbers/code/modules/mod/modules.dm @@ -74,6 +74,12 @@ if(!mod.ai_assistant) balloon_alert(mod.wearer, "no AI present") return + if(isnull(mod.wearer.client)) + balloon_alert(mod.ai_assistant, "host is unresponsive") + return + if(isnull(mod.ai_assistant.client)) + balloon_alert(mod.wearer, "AI is unresponsive") + return return ..() /obj/item/mod/module/mind_swap/on_activation() @@ -85,12 +91,17 @@ /obj/item/mod/module/mind_swap/on_suit_activation() ai_key = mod.ai_assistant?.key wearer_key = mod.wearer.key + ai_control = FALSE /obj/item/mod/module/mind_swap/on_suit_deactivation(deleting = FALSE) if(wearer_key != mod.wearer.key) swap_minds() /obj/item/mod/module/mind_swap/proc/swap_minds() + if(!mod.ai_assistant) + mod.wearer.ghostize(FALSE) + mod.ai_assistant.key = ai_key + return mod.wearer.ghostize(FALSE) mod.ai_assistant.ghostize(FALSE) if(ai_control)