From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Wed, 14 Jan 2026 23:39:50 +0000 (-0800) Subject: Fix TryAllReactionsTest reacting early and not checking priority (#42412) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1f80b6a95d72ba199e805934f216ba13fff17040;p=space-station-14.git Fix TryAllReactionsTest reacting early and not checking priority (#42412) --- diff --git a/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs b/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs index 6d860f0ac3..13d8bdc6d2 100644 --- a/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs +++ b/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs @@ -50,11 +50,12 @@ namespace Content.IntegrationTests.Tests.Chemistry beaker = entityManager.SpawnEntity("TestSolutionContainer", coordinates); Assert.That(solutionContainerSystem .TryGetSolution(beaker, "beaker", out solutionEnt, out solution)); + solutionEnt.Value.Comp.Solution.CanReact = false; foreach (var (id, reactant) in reactionPrototype.Reactants) { #pragma warning disable NUnit2045 Assert.That(solutionContainerSystem - .TryAddReagent(solutionEnt.Value, id, reactant.Amount, out var quantity)); + .TryAddReagent(solutionEnt.Value, id, reactant.Amount, out var quantity, reactionPrototype.MinimumTemperature)); Assert.That(reactant.Amount, Is.EqualTo(quantity)); #pragma warning restore NUnit2045 } @@ -67,7 +68,7 @@ namespace Content.IntegrationTests.Tests.Chemistry //Check if the reaction is the first to occur when heated foreach (var possibleReaction in possibleReactions.OrderBy(r => r.MinimumTemperature)) { - if (possibleReaction.MinimumTemperature < reactionPrototype.MinimumTemperature && possibleReaction.MixingCategories == reactionPrototype.MixingCategories) + if (possibleReaction.Priority >= reactionPrototype.Priority && possibleReaction.MinimumTemperature < reactionPrototype.MinimumTemperature && possibleReaction.MixingCategories == reactionPrototype.MixingCategories) { Assert.Fail($"The {possibleReaction.ID} reaction may occur before {reactionPrototype.ID} when heated."); } @@ -76,14 +77,16 @@ namespace Content.IntegrationTests.Tests.Chemistry //Check if the reaction is the first to occur when freezing foreach (var possibleReaction in possibleReactions.OrderBy(r => r.MaximumTemperature)) { - if (possibleReaction.MaximumTemperature > reactionPrototype.MaximumTemperature && possibleReaction.MixingCategories == reactionPrototype.MixingCategories) + if (possibleReaction.Priority >= reactionPrototype.Priority && possibleReaction.MaximumTemperature > reactionPrototype.MaximumTemperature && possibleReaction.MixingCategories == reactionPrototype.MixingCategories) { Assert.Fail($"The {possibleReaction.ID} reaction may occur before {reactionPrototype.ID} when freezing."); } } //Now safe set the temperature and mix the reagents + solutionEnt.Value.Comp.Solution.CanReact = true; solutionContainerSystem.SetTemperature(solutionEnt.Value, reactionPrototype.MinimumTemperature); + solutionContainerSystem.UpdateChemicals(solutionEnt.Value); if (reactionPrototype.MixingCategories != null) {