StackSystem uses EntityUid for Split and Spawn

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 15:34:40 +01:00
parent 6f2cc733e7
commit 8b57bafcd1
13 changed files with 60 additions and 44 deletions

View File

@@ -27,9 +27,9 @@ namespace Content.Shared.Construction.Steps
examinedEvent.Message.AddMarkup(Loc.GetString("construction-insert-material-entity", ("amount", Amount), ("materialName", material.Name)));
}
public override bool EntityValid(IEntity entity)
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
{
return entity.TryGetComponent(out SharedStackComponent? stack) && stack.StackTypeId.Equals(MaterialPrototypeId) && stack.Count >= Amount;
return entityManager.TryGetComponent(uid, out SharedStackComponent? stack) && stack.StackTypeId.Equals(MaterialPrototypeId) && stack.Count >= Amount;
}
public bool EntityValid(IEntity entity, [NotNullWhen(true)] out SharedStackComponent? stack)