From 5280f0cebe93dd1333754ae7528a53eb63c22c3a Mon Sep 17 00:00:00 2001 From: NopeOfAllNopes <78011942+NopeOfAllNopes@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:03:10 -0700 Subject: [PATCH] Mech Control Panel now closes on Pilot Eject. (#45036) * Fix for mech control panel not closing on pilot exit. * Added line spaces back to maintain formatting. * Check for TryEject to see if we should actually close the UI. * Added second _ui.CloseUI() to OnMechExit event, will properly close UI for pilot if they are forcefully ejected from the cockpit. --- Content.Server/Mech/Systems/MechSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Server/Mech/Systems/MechSystem.cs b/Content.Server/Mech/Systems/MechSystem.cs index 7a82d51dab..105a3f4144 100644 --- a/Content.Server/Mech/Systems/MechSystem.cs +++ b/Content.Server/Mech/Systems/MechSystem.cs @@ -184,7 +184,8 @@ public sealed partial class MechSystem : SharedMechSystem { if (args.User == uid || args.User == operatorUid) { - TryEject(uid, component); + if(TryEject(uid, component)) + _ui.CloseUi(uid, MechUiKey.Key); return; } @@ -226,6 +227,7 @@ public sealed partial class MechSystem : SharedMechSystem if (!TryEject(uid, component)) return; + _ui.CloseUi(uid, MechUiKey.Key); args.Handled = true; }