Fix solutions flickering when transferring contents (#34838)

* Use Solution clones when applying SolutionComponent states

* Revert "Use Solution clones when applying SolutionComponent states"

This reverts commit 013fd111cf92b22562e00f98a7aaa49bc4b4ed62.

* Make Solution implement ICloneable and rename Clone method.

* Copy CanReact value when cloning a Solution

* Convert to IRobustCloneable
This commit is contained in:
Tayrtahn
2025-06-27 20:13:24 -04:00
committed by GitHub
parent 7f530bb7ad
commit 948ecc8279

View File

@@ -15,7 +15,7 @@ namespace Content.Shared.Chemistry.Components
/// </summary>
[Serializable, NetSerializable]
[DataDefinition]
public sealed partial class Solution : IEnumerable<ReagentQuantity>, ISerializationHooks
public sealed partial class Solution : IEnumerable<ReagentQuantity>, ISerializationHooks, IRobustCloneable<Solution>
{
// This is a list because it is actually faster to add and remove reagents from
// a list than a dictionary, though contains-reagent checks are slightly slower,
@@ -174,6 +174,7 @@ namespace Content.Shared.Chemistry.Components
Volume = solution.Volume;
MaxVolume = solution.MaxVolume;
Temperature = solution.Temperature;
CanReact = solution.CanReact;
_heatCapacity = solution._heatCapacity;
_heatCapacityDirty = solution._heatCapacityDirty;
_heatCapacityUpdateCounter = solution._heatCapacityUpdateCounter;