Generalizes solution overflow & slightly increases space lube yield (#21094)
* generalize SolutionSpikeOverflowEvent * let reactions overflow * spacelube: 3 -> 5 * restore TryMixAndOverflow threshold cap
This commit is contained in:
@@ -262,12 +262,6 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
if (products.Count == 0)
|
||||
return true;
|
||||
|
||||
// remove excess product
|
||||
// TODO spill excess?
|
||||
var excessVolume = solution.Volume - maxVolume;
|
||||
if (excessVolume > 0)
|
||||
solution.RemoveSolution(excessVolume);
|
||||
|
||||
// Add any reactions associated with the new products. This may re-add reactions that were already iterated
|
||||
// over previously. The new product may mean the reactions are applicable again and need to be processed.
|
||||
foreach (var product in products)
|
||||
@@ -279,16 +273,10 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Continually react a solution until no more reactions occur.
|
||||
/// </summary>
|
||||
public void FullyReactSolution(Solution solution, EntityUid owner) => FullyReactSolution(solution, owner, FixedPoint2.MaxValue, null);
|
||||
|
||||
/// <summary>
|
||||
/// Continually react a solution until no more reactions occur, with a volume constraint.
|
||||
/// If a reaction's products would exceed the max volume, some product is deleted.
|
||||
/// </summary>
|
||||
public void FullyReactSolution(Solution solution, EntityUid owner, FixedPoint2 maxVolume, ReactionMixerComponent? mixerComponent)
|
||||
public void FullyReactSolution(Solution solution, EntityUid owner, FixedPoint2 maxVolume, ReactionMixerComponent? mixerComponent = null)
|
||||
{
|
||||
// construct the initial set of reactions to check.
|
||||
SortedSet<ReactionPrototype> reactions = new();
|
||||
|
||||
Reference in New Issue
Block a user