diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 32cb46cf2c4..c606e031bc2 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -812,10 +812,21 @@ if(!construction_state) //Mech must be in maint mode to allow carding. to_chat(user, "[name] must have maintenance protocols active in order to allow a transfer.") return - if(!locate(AI) in occupants) //Mech does not have an AI for a pilot + var/list/ai_pilots = list() + for(var/mob/living/silicon/ai/aipilot in occupants) + ai_pilots += aipilot + if(!ai_pilots.len) //Mech does not have an AI for a pilot to_chat(user, "No AI detected in the [name] onboard computer.") return - for(var/mob/living/silicon/ai in occupants) + if(ai_pilots.len > 1) //Input box for multiple AIs, but if there's only one we'll default to them. + AI = input(user,"Which AI do you wish to card?", "AI Selection") as null|anything in sortList(ai_pilots) + else + AI = ai_pilots[1] + if(!AI) + return + if(!(AI in occupants) || !user.Adjacent(src)) + return //User sat on the selection window and things changed. + AI.ai_restore_power()//So the AI initially has power. AI.control_disabled = TRUE AI.radio_enabled = FALSE