Revert "Revert "Fix some friend access violations by allowing others access. (#8594) (#8703)" (working this time) (#8704)

This commit is contained in:
Pieter-Jan Briers
2022-06-07 15:26:28 +02:00
committed by GitHub
parent cecf87997b
commit a323ba8223
164 changed files with 199 additions and 171 deletions

View File

@@ -25,12 +25,12 @@ namespace Content.Shared.Construction.Steps
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
{
return entityManager.TryGetComponent(uid, out SharedStackComponent? stack) && stack.StackTypeId.Equals(MaterialPrototypeId) && stack.Count >= Amount;
return entityManager.TryGetComponent(uid, out SharedStackComponent? stack) && stack.StackTypeId == MaterialPrototypeId && stack.Count >= Amount;
}
public bool EntityValid(EntityUid entity, [NotNullWhen(true)] out SharedStackComponent? stack)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedStackComponent? otherStack) && otherStack.StackTypeId.Equals(MaterialPrototypeId) && otherStack.Count >= Amount)
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedStackComponent? otherStack) && otherStack.StackTypeId == MaterialPrototypeId && otherStack.Count >= Amount)
stack = otherStack;
else
stack = null;