]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup atmos air grenade code (#37568)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sun, 18 May 2025 12:18:31 +0000 (14:18 +0200)
committerGitHub <noreply@github.com>
Sun, 18 May 2025 12:18:31 +0000 (22:18 +1000)
cleanup

Content.Server/Explosion/EntitySystems/ReleaseGasOnTriggerSystem.cs
Content.Shared/Explosion/Components/OnTrigger/ReleaseGasOnTriggerComponent.cs

index 09b6e1bf2466d0f54038305e49ec2926652f65c1..ae3f84f84390cfaa0311266052256d6ef1bdda6a 100644 (file)
@@ -66,27 +66,14 @@ public sealed partial class ReleaseGasOnTriggerSystem : SharedReleaseGasOnTrigge
                 RemCompDeferred<ReleaseGasOnTriggerComponent>(uid);
                 continue;
             }
-
-            if (comp.ExponentialRise)
-                UpdateExponentialRise(comp, comp.RemoveFraction);
         }
     }
 
-    /// <summary>
-    /// Updates the RemoveFraction for exponential rise.
-    /// </summary>
-    /// <remarks>See https://www.desmos.com/calculator/fx9gfrhoim</remarks>
-    private static void UpdateExponentialRise(ReleaseGasOnTriggerComponent comp, float baseFraction)
-    {
-        comp.TimesReleased++;
-        comp.RemoveFraction = 1f - MathF.Pow(1f - baseFraction, comp.TimesReleased);
-    }
-
     private void UpdateAppearance(Entity<AppearanceComponent?> entity, bool state)
     {
         if (!Resolve(entity, ref entity.Comp, false))
             return;
 
-        _appearance.SetData(entity, ReleaseGasOnTriggerComponent.ReleaseGasOnTriggerVisuals.Key, state);
+        _appearance.SetData(entity, ReleaseGasOnTriggerVisuals.Key, state);
     }
 }
index 5072b89dd24da1df1c70582190f953842ecd7d25..28a5c5cf813515d439377693c7f85289fd2a8a00 100644 (file)
@@ -14,16 +14,6 @@ namespace Content.Shared.Explosion.Components.OnTrigger;
 [Access(typeof(SharedReleaseGasOnTriggerSystem))]
 public sealed partial class ReleaseGasOnTriggerComponent : Component
 {
-    /// <summary>
-    /// Represents visual states for whatever visuals that need to be applied
-    /// on state changes.
-    /// </summary>
-    [Serializable] [NetSerializable]
-    public enum ReleaseGasOnTriggerVisuals : byte
-    {
-        Key,
-    }
-
     /// <summary>
     /// Whether this grenade is active and releasing gas.
     /// Set to true when triggered, which starts gas release.
@@ -37,12 +27,6 @@ public sealed partial class ReleaseGasOnTriggerComponent : Component
     [DataField]
     public GasMixture Air;
 
-    /// <summary>
-    /// If true, the gas will be released in an exponential manner.
-    /// </summary>
-    [DataField]
-    public bool ExponentialRise;
-
     /// <summary>
     /// Time at which the next release will occur.
     /// This is automatically set when the grenade activates.
@@ -53,7 +37,7 @@ public sealed partial class ReleaseGasOnTriggerComponent : Component
 
     /// <summary>
     /// The cap at which this grenade can fill the exposed atmosphere to.
-    /// The grenade automatically deletes itself when the pressure is reached.
+    /// This component automatically removes itself when the pressure limit is reached.
     /// </summary>
     /// <example>If set to 101.325, the grenade will only fill the exposed
     /// atmosphere up to 101.325 kPa.</example>
@@ -83,11 +67,14 @@ public sealed partial class ReleaseGasOnTriggerComponent : Component
     /// <remarks>Set when the grenade is activated.</remarks>
     [DataField(readOnly: true)]
     public float StartingTotalMoles;
+}
 
-    /// <summary>
-    /// Stores the number of times the grenade has been released,
-    /// for exponential rise calculations.
-    /// </summary>
-    [DataField]
-    public int TimesReleased;
+/// <summary>
+/// Represents visual states for whatever visuals that need to be applied
+/// on state changes.
+/// </summary>
+[Serializable, NetSerializable]
+public enum ReleaseGasOnTriggerVisuals : byte
+{
+    Key,
 }