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

@@ -147,8 +147,8 @@ public sealed class PayloadSystem : EntitySystem
|| !TryComp(beakerB, out FitsInDispenserComponent? compB)
|| !_solutionSystem.TryGetSolution(beakerA, compA.Solution, out var solutionA)
|| !_solutionSystem.TryGetSolution(beakerB, compB.Solution, out var solutionB)
|| solutionA.TotalVolume == 0
|| solutionB.TotalVolume == 0)
|| solutionA.Volume == 0
|| solutionB.Volume == 0)
{
return;
}
@@ -164,7 +164,7 @@ public sealed class PayloadSystem : EntitySystem
_solutionSystem.RemoveAllSolution(beakerB, solutionB);
// The grenade might be a dud. Redistribute solution:
var tmpSol = _solutionSystem.SplitSolution(beakerA, solutionA, solutionA.CurrentVolume * solutionB.MaxVolume / solutionA.MaxVolume);
var tmpSol = _solutionSystem.SplitSolution(beakerA, solutionA, solutionA.Volume * solutionB.MaxVolume / solutionA.MaxVolume);
_solutionSystem.TryAddSolution(beakerB, solutionB, tmpSol);
solutionA.MaxVolume -= solutionB.MaxVolume;
_solutionSystem.UpdateChemicals(beakerA, solutionA, false);