]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup prototype instantiation in `ExplosionSystem` (#38642)
authorTayrtahn <tayrtahn@gmail.com>
Sat, 28 Jun 2025 19:34:15 +0000 (15:34 -0400)
committerGitHub <noreply@github.com>
Sat, 28 Jun 2025 19:34:15 +0000 (21:34 +0200)
Cleanup prototype instantiation in ExplosionSystem

Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs

index 3f08532e37a06a0af034eaf0207605c026b8737a..b61f78e909a9f75a38739a7a784614969b7c52bf 100644 (file)
@@ -913,10 +913,10 @@ sealed class Explosion
 /// <summary>
 /// Data needed to spawn an explosion with <see cref="ExplosionSystem.SpawnExplosion"/>.
 /// </summary>
-public sealed class QueuedExplosion
+public sealed class QueuedExplosion(ExplosionPrototype proto)
 {
     public MapCoordinates Epicenter;
-    public ExplosionPrototype Proto = new();
+    public ExplosionPrototype Proto = proto;
     public float TotalIntensity, Slope, MaxTileIntensity, TileBreakScale;
     public int MaxTileBreak;
     public bool CanCreateVacuum;
index ffdc90f9d63e0728a071e539f2a12c0852a9a2c3..0cdc6d6b23d69641675b2b545dab2f487cafef89 100644 (file)
@@ -306,10 +306,9 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
             return;
         }
 
-        var boom = new QueuedExplosion()
+        var boom = new QueuedExplosion(type)
         {
             Epicenter = epicenter,
-            Proto = type,
             TotalIntensity = totalIntensity,
             Slope = slope,
             MaxTileIntensity = maxTileIntensity,