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.
This commit is contained in:
NopeOfAllNopes 2026-08-09 21:03:10 -07:00 • committed by GitHub
parent 49f8774d9d
commit 5280f0cebe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}