[TEST MERGE] Slot-based Storage (#21212)

This commit is contained in:
Nemanja
2023-10-25 18:53:38 -04:00
committed by GitHub
parent 6b04aaf964
commit 41795720da
234 changed files with 1052 additions and 1008 deletions

View File

@@ -187,7 +187,7 @@ namespace Content.Server.Chemistry.EntitySystems
}
// Ensure the number is valid.
if (message.Number == 0 || message.Number > storage.StorageCapacityMax - storage.StorageUsed)
if (message.Number == 0 || _storageSystem.HasSpace((chemMaster, storage)))
return;
// Ensure the amount is valid.
@@ -345,7 +345,7 @@ namespace Content.Server.Chemistry.EntitySystems
}
}
if (!TryComp(container, out StorageComponent? storage))
if (!TryComp(container, out StorageComponent? storage) || storage.Container == null)
return null;
var pills = storage.Container?.ContainedEntities.Select((Func<EntityUid, (string, FixedPoint2 quantity)>) (pill =>
@@ -358,7 +358,7 @@ namespace Content.Server.Chemistry.EntitySystems
if (pills == null)
return null;
return new ContainerInfo(name, storage.StorageUsed, storage.StorageCapacityMax)
return new ContainerInfo(name, storage.Container!.ContainedEntities.Count, storage.MaxSlots)
{
Entities = pills
};