Remove many resolves on Content.Server

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:04:21 +01:00
parent 420039f278
commit ba736f70df
72 changed files with 407 additions and 302 deletions

View File

@@ -21,13 +21,15 @@ namespace Content.Server.AI.Operators.Inventory
public override Outcome Execute(float frameTime)
{
var entMan = IoCManager.Resolve<IEntityManager>();
// TODO: Also have this check storage a la backpack etc.
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out HandsComponent? handsComponent))
if (!entMan.TryGetComponent(_owner, out HandsComponent? handsComponent))
{
return Outcome.Failed;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(_target, out ItemComponent? itemComponent))
if (!entMan.TryGetComponent(_target, out ItemComponent? itemComponent))
{
return Outcome.Failed;
}