Inline TryGetComponent completely, for real

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:17:01 +01:00
parent 2ff4ec65d5
commit 69b270017b
425 changed files with 1143 additions and 995 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Doors;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Server.Doors.Systems
@@ -87,7 +88,7 @@ namespace Content.Server.Doors.Systems
private void OnDoorClickShouldActivate(EntityUid uid, AirlockComponent component, DoorClickShouldActivateEvent args)
{
if (component.WiresComponent != null && component.WiresComponent.IsPanelOpen &&
args.Args.User.TryGetComponent(out ActorComponent? actor))
IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Args.User.Uid, out ActorComponent? actor))
{
component.WiresComponent.OpenInterface(actor.PlayerSession);
args.Handled = true;