Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -8,6 +8,7 @@ using System.Collections.Generic;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Content.Shared.Popups;
using Robust.Shared.IoC;
namespace Content.Server.Chemistry.EntitySystems
{
@@ -31,9 +32,9 @@ namespace Content.Server.Chemistry.EntitySystems
if (!args.CanAccess || !args.CanInteract || !component.CanChangeTransferAmount)
return;
if (!args.User.TryGetComponent<ActorComponent>(out var actor))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User.Uid, out var actor))
return;
// Custom transfer verb
Verb custom = new();
custom.Text = Loc.GetString("comp-solution-transfer-verb-custom-amount");
@@ -61,7 +62,7 @@ namespace Content.Server.Chemistry.EntitySystems
// we want to sort by size, not alphabetically by the verb text.
verb.Priority = priority;
priority--;
args.Verbs.Add(verb);
}
}