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

@@ -18,8 +18,8 @@ namespace Content.Shared.Lathe
public bool CanProduce(LatheRecipePrototype recipe, int quantity = 1)
{
if (!Owner.TryGetComponent(out SharedMaterialStorageComponent? storage)
|| !Owner.TryGetComponent(out SharedLatheDatabaseComponent? database)) return false;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out SharedMaterialStorageComponent? storage)
|| !IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out SharedLatheDatabaseComponent? database)) return false;
if (!database.Contains(recipe)) return false;