Revert "Storage TEST MERGE" (#21258)
This commit is contained in:
@@ -180,13 +180,14 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
var user = message.Session.AttachedEntity;
|
||||
var maybeContainer = _itemSlotsSystem.GetItemOrNull(chemMaster, SharedChemMaster.OutputSlotName);
|
||||
if (maybeContainer is not { Valid: true } container
|
||||
|| !TryComp(container, out StorageComponent? storage))
|
||||
|| !TryComp(container, out StorageComponent? storage)
|
||||
|| storage.Container is null)
|
||||
{
|
||||
return; // output can't fit pills
|
||||
}
|
||||
|
||||
// Ensure the number is valid.
|
||||
if (message.Number == 0 || !_storageSystem.HasSpace((container, storage)))
|
||||
if (message.Number == 0 || message.Number > storage.StorageCapacityMax - storage.StorageUsed)
|
||||
return;
|
||||
|
||||
// Ensure the amount is valid.
|
||||
@@ -344,7 +345,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
if (!TryComp(container, out StorageComponent? storage) || storage.Container == null)
|
||||
if (!TryComp(container, out StorageComponent? storage))
|
||||
return null;
|
||||
|
||||
var pills = storage.Container?.ContainedEntities.Select((Func<EntityUid, (string, FixedPoint2 quantity)>) (pill =>
|
||||
@@ -357,7 +358,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
if (pills == null)
|
||||
return null;
|
||||
|
||||
return new ContainerInfo(name, storage.Container!.ContainedEntities.Count, storage.MaxSlots)
|
||||
return new ContainerInfo(name, storage.StorageUsed, storage.StorageCapacityMax)
|
||||
{
|
||||
Entities = pills
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user