Inline TryGetComponent completely
This commit is contained in:
@@ -7,6 +7,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.Buckle.Systems
|
||||
@@ -40,7 +41,7 @@ namespace Content.Server.Buckle.Systems
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract || !component.Buckled)
|
||||
return;
|
||||
|
||||
|
||||
Verb verb = new();
|
||||
verb.Act = () => component.TryUnbuckle(args.User);
|
||||
verb.Text = Loc.GetString("verb-categories-unbuckle");
|
||||
@@ -94,7 +95,7 @@ namespace Content.Server.Buckle.Systems
|
||||
// This fixes buckle offsets and draw depths.
|
||||
foreach (var buckledEntity in strap.BuckledEntities)
|
||||
{
|
||||
if (!buckledEntity.TryGetComponent(out BuckleComponent? buckled))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity.Uid, out BuckleComponent? buckled))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -111,7 +112,7 @@ namespace Content.Server.Buckle.Systems
|
||||
{
|
||||
foreach (var buckledEntity in strap.BuckledEntities)
|
||||
{
|
||||
if (!buckledEntity.TryGetComponent(out BuckleComponent? buckled))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity.Uid, out BuckleComponent? buckled))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user