Fixed canister being unlocked and opening the Ui at the same time when left-clicking it (#17750)

This commit is contained in:
Vocal Night 2023-06-30 16:39:34 -03:00 committed by GitHub
parent df4be31186
commit cf995dec6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,7 @@ public sealed class GasCanisterSystem : EntitySystem
SubscribeLocalEvent<GasCanisterComponent, ComponentStartup>(OnCanisterStartup);
SubscribeLocalEvent<GasCanisterComponent, AtmosDeviceUpdateEvent>(OnCanisterUpdated);
SubscribeLocalEvent<GasCanisterComponent, ActivateInWorldEvent>(OnCanisterActivate);
SubscribeLocalEvent<GasCanisterComponent, ActivateInWorldEvent>(OnCanisterActivate, after: new[] { typeof(LockSystem) });
SubscribeLocalEvent<GasCanisterComponent, InteractHandEvent>(OnCanisterInteractHand);
SubscribeLocalEvent<GasCanisterComponent, InteractUsingEvent>(OnCanisterInteractUsing);
SubscribeLocalEvent<GasCanisterComponent, EntInsertedIntoContainerMessage>(OnCanisterContainerInserted);
@ -230,6 +230,11 @@ public sealed class GasCanisterSystem : EntitySystem
if (CheckLocked(uid, component, args.User))
return;
// Needs to be here so the locked check still happens if the canister
// is locked and you don't have permissions
if (args.Handled)
return;
_ui.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
args.Handled = true;
}