From a26bafacb1b2d81b40a19274edda40aca14cb696 Mon Sep 17 00:00:00 2001 From: beck-thompson <107373427+beck-thompson@users.noreply.github.com> Date: Sun, 21 Sep 2025 23:40:13 -0700 Subject: [PATCH] Shuttle UI now properly goes into pilot mode only when using the UI (#40491) Shuttle UI bug fix --- Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs | 7 +++---- Content.Shared/UserInterface/ActivatableUIEvents.cs | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index cbd6abe9f5..126c4f963c 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -56,7 +56,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem SubscribeLocalEvent(OnConsoleShutdown); SubscribeLocalEvent(OnConsolePowerChange); SubscribeLocalEvent(OnConsoleAnchorChange); - SubscribeLocalEvent(OnConsoleUIOpenAttempt); + SubscribeLocalEvent(OnConsoleUIOpenAttempt); Subs.BuiEvents(ShuttleConsoleUiKey.Key, subs => { subs.Event(OnBeaconFTLMessage); @@ -150,10 +150,9 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem } private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component, - ActivatableUIOpenAttemptEvent args) + AfterActivatableUIOpenEvent args) { - if (!TryPilot(args.User, uid)) - args.Cancel(); + TryPilot(args.User, uid); } private void OnConsoleAnchorChange(EntityUid uid, ShuttleConsoleComponent component, diff --git a/Content.Shared/UserInterface/ActivatableUIEvents.cs b/Content.Shared/UserInterface/ActivatableUIEvents.cs index 338673a3ca..ef2a7b1b9f 100644 --- a/Content.Shared/UserInterface/ActivatableUIEvents.cs +++ b/Content.Shared/UserInterface/ActivatableUIEvents.cs @@ -1,6 +1,9 @@ -using Robust.Shared.Player; - namespace Content.Shared.UserInterface; + +/// +/// This is raised BEFORE opening a UI! Do not listen and then open / do something use +/// for that. +/// public sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs { public EntityUid User { get; }