Inline TryGetComponent completely, for real
This commit is contained in:
@@ -92,7 +92,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|
||||
private void OnPumpInteractHand(EntityUid uid, GasPressurePumpComponent component, InteractHandEvent args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (component.Owner.Transform.Anchored)
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
|
||||
private void OnFilterInteractHand(EntityUid uid, GasFilterComponent component, InteractHandEvent args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (component.Owner.Transform.Anchored)
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
|
||||
private void OnMixerInteractHand(EntityUid uid, GasMixerComponent component, InteractHandEvent args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (component.Owner.Transform.Anchored)
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnCanisterActivate(EntityUid uid, GasCanisterComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession);
|
||||
@@ -254,7 +254,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnCanisterInteractHand(EntityUid uid, GasCanisterComponent component, InteractHandEvent args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession);
|
||||
@@ -271,11 +271,11 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
return;
|
||||
|
||||
// Check the used item is valid...
|
||||
if (!args.Used.TryGetComponent(out GasTankComponent? _))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Used.Uid, out GasTankComponent? _))
|
||||
return;
|
||||
|
||||
// Check the user has hands.
|
||||
if (!args.User.TryGetComponent(out HandsComponent? hands))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out HandsComponent? hands))
|
||||
return;
|
||||
|
||||
if (!args.User.InRangeUnobstructed(canister, SharedInteractionSystem.InteractionRange, popup: true))
|
||||
|
||||
Reference in New Issue
Block a user