The entity spawned when an item is thrown from a stack now properly sets its stack size to 1. This resolves https://github.com/space-wizards/space-station-14/issues/312.
This commit is contained in:
@@ -155,6 +155,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
stackComp.Use(1);
|
stackComp.Use(1);
|
||||||
throwEnt = throwEnt.EntityManager.SpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition);
|
throwEnt = throwEnt.EntityManager.SpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition);
|
||||||
|
|
||||||
|
// can only throw one item at a time, regardless of what the prototype stack size is.
|
||||||
|
if (throwEnt.TryGetComponent<StackComponent>(out var newStackComp))
|
||||||
|
newStackComp.Count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!throwEnt.TryGetComponent(out CollidableComponent colComp))
|
if (!throwEnt.TryGetComponent(out CollidableComponent colComp))
|
||||||
|
|||||||
Reference in New Issue
Block a user