Solution rejig (#12428)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user