mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
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  <details> <summary>Screenshots/Videos</summary> </details> ## Changelog 🆑 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 /🆑
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user