Even more resolve removals.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:32:32 +01:00
parent 684cb76173
commit cdc8336695
61 changed files with 364 additions and 278 deletions

View File

@@ -41,10 +41,11 @@ namespace Content.Shared.Actions.Behaviors.Item
Performer = performer;
ActionType = actionType;
Item = item;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Item, out ItemActions))
var entMan = IoCManager.Resolve<IEntityManager>();
if (!entMan.TryGetComponent(Item, out ItemActions))
{
throw new InvalidOperationException($"performer {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(performer).EntityName} tried to perform item action {actionType} " +
$" for item {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Item).EntityName} but the item had no ItemActionsComponent," +
throw new InvalidOperationException($"performer {entMan.GetComponent<MetaDataComponent>(performer).EntityName} tried to perform item action {actionType} " +
$" for item {entMan.GetComponent<MetaDataComponent>(Item).EntityName} but the item had no ItemActionsComponent," +
" which should never occur");
}
}