Solution rejig (#12428)

This commit is contained in:
Leon Friedrich
2023-01-12 16:41:40 +13:00
committed by GitHub
parent 38504f6412
commit 466384b081
61 changed files with 873 additions and 619 deletions

View File

@@ -1,4 +1,4 @@
using Content.Server.Body.Components;
using Content.Server.Body.Components;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Server.Chemistry.EntitySystems;
using Content.Shared.Body.Organ;
@@ -47,7 +47,7 @@ namespace Content.Server.Body.Systems
delta.Increment(stomach.UpdateInterval);
if (delta.Lifetime > stomach.DigestionDelay)
{
if (stomachSolution.ContainsReagent(delta.ReagentId, out var quant))
if (stomachSolution.TryGetReagent(delta.ReagentId, out var quant))
{
if (quant > delta.Quantity)
quant = delta.Quantity;
@@ -89,8 +89,7 @@ namespace Content.Server.Body.Systems
private void OnComponentInit(EntityUid uid, StomachComponent component, ComponentInit args)
{
var solution = _solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName);
solution.MaxVolume = component.InitialMaxVolume;
_solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName, component.InitialMaxVolume, out _);
}
public bool CanTransferSolution(EntityUid uid, Solution solution,