Inline TryGetComponent completely
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user