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:
Acruid
2019-09-01 16:23:30 -07:00
parent 9ffbb51fd1
commit 7a55c07e22

View File

@@ -155,6 +155,10 @@ namespace Content.Server.GameObjects.EntitySystems
{
stackComp.Use(1);
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))