Update StackSystem to use Resolves. (#4664)
* Update StackSystem to use Resolves. * Compile
This commit is contained in:
committed by
GitHub
parent
ae2b70072f
commit
61d8852799
@@ -16,9 +16,8 @@ namespace Content.Server.Construction.Completions
|
||||
public async Task PerformAction(IEntity entity, IEntity? user)
|
||||
{
|
||||
if (entity.Deleted) return;
|
||||
if(!entity.TryGetComponent<StackComponent>(out var stack)) return;
|
||||
|
||||
EntitySystem.Get<StackSystem>().SetCount(entity.Uid, stack, Amount);
|
||||
EntitySystem.Get<StackSystem>().SetCount(entity.Uid, Amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.Construction.Completions
|
||||
{
|
||||
var stackEnt = entityManager.SpawnEntity(Prototype, coordinates);
|
||||
var stack = stackEnt.GetComponent<StackComponent>();
|
||||
EntitySystem.Get<StackSystem>().SetCount(stackEnt.Uid, stack, Amount);
|
||||
EntitySystem.Get<StackSystem>().SetCount(stackEnt.Uid, Amount, stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace Content.Server.Construction.Components
|
||||
if (materialStep.EntityValid(eventArgs.Using, out var stack)
|
||||
&& await doAfterSystem.WaitDoAfter(doAfterArgs) == DoAfterStatus.Finished)
|
||||
{
|
||||
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using.Uid, stack, materialStep.Amount, eventArgs.User.Transform.Coordinates);
|
||||
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using.Uid, materialStep.Amount, eventArgs.User.Transform.Coordinates, stack);
|
||||
|
||||
if (splitStack != null)
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace Content.Server.Construction.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using.Uid, stack, needed, Owner.Transform.Coordinates);
|
||||
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using.Uid, needed, Owner.Transform.Coordinates, stack);
|
||||
|
||||
if (splitStack == null)
|
||||
return false;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.Construction.Components
|
||||
// TODO: If something has a stack... Just use a prototype with a single thing in the stack.
|
||||
// This is not a good way to do it.
|
||||
if (droppedEnt.TryGetComponent<StackComponent>(out var stack))
|
||||
EntitySystem.Get<StackSystem>().SetCount(droppedEnt.Uid, stack, 1);
|
||||
EntitySystem.Get<StackSystem>().SetCount(droppedEnt.Uid,1, stack);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace Content.Server.Construction
|
||||
if (!materialStep.EntityValid(entity, out var stack))
|
||||
continue;
|
||||
|
||||
var splitStack = _stackSystem.Split(entity.Uid, stack, materialStep.Amount, user.ToCoordinates());
|
||||
var splitStack = _stackSystem.Split(entity.Uid, materialStep.Amount, user.ToCoordinates(), stack);
|
||||
|
||||
if (splitStack == null)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user