]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add atmos ignition logs (#14216)
authorChief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
Tue, 28 Feb 2023 20:43:24 +0000 (14:43 -0600)
committerGitHub <noreply@github.com>
Tue, 28 Feb 2023 20:43:24 +0000 (16:43 -0400)
Content.Server/Anomaly/Effects/PyroclasticAnomalySystem.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs
Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Content.Server/IgnitionSource/IgnitionSourceSystem.cs
Content.Server/Light/EntitySystems/MatchstickSystem.cs
Content.Server/Nutrition/EntitySystems/SmokingSystem.cs
Content.Server/StationEvents/Events/GasLeak.cs
Content.Server/Tools/ToolSystem.Welder.cs

index 8e656a58c8ff2bbffc1f3c5d2df548b900d4fafa..5d86c31f4600e41c2fabe70ed689a974b6892da9 100644 (file)
@@ -55,7 +55,7 @@ public sealed class PyroclasticAnomalySystem : EntitySystem
 
                 mix.AdjustMoles(component.SupercriticalGas, component.SupercriticalMoleAmount);
                 mix.Temperature += component.HotspotExposeTemperature;
-                _atmosphere.HotspotExpose(grid.Value, indices, component.HotspotExposeTemperature, mix.Volume, true);
+                _atmosphere.HotspotExpose(grid.Value, indices, component.HotspotExposeTemperature, mix.Volume, uid, true);
             }
         }
         IgniteNearby(xform.Coordinates, 1, component.MaximumIgnitionRadius * 2);
@@ -80,7 +80,7 @@ public sealed class PyroclasticAnomalySystem : EntitySystem
 
             if (grid != null && anom.Severity > pyro.AnomalyHotspotThreshold)
             {
-                _atmosphere.HotspotExpose(grid.Value, indices, pyro.HotspotExposeTemperature, pyro.HotspotExposeVolume, true);
+                _atmosphere.HotspotExpose(grid.Value, indices, pyro.HotspotExposeTemperature, pyro.HotspotExposeVolume, ent, true);
             }
         }
     }
index 06cfe5cad694165a0c5c5ead48c86590e87f24fb..03a07a2e5f368d81049c2fa0f9eec47949296b63 100644 (file)
@@ -216,9 +216,10 @@ public partial class AtmosphereSystem
         RaiseLocalEvent(gridUid, ref ev);
     }
 
-    public void HotspotExpose(EntityUid gridUid, Vector2i tile, float exposedTemperature, float exposedVolume, bool soh = false)
+    public void HotspotExpose(EntityUid gridUid, Vector2i tile, float exposedTemperature, float exposedVolume,
+        EntityUid? sparkSourceUid = null, bool soh = false)
     {
-        var ev = new HotspotExposeMethodEvent(gridUid, tile, exposedTemperature, exposedVolume, soh);
+        var ev = new HotspotExposeMethodEvent(gridUid, sparkSourceUid, tile, exposedTemperature, exposedVolume, soh);
         RaiseLocalEvent(gridUid, ref ev);
     }
 
@@ -300,7 +301,7 @@ public partial class AtmosphereSystem
     [ByRefEvent] private record struct IsTileAirBlockedMethodEvent
         (EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, MapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false)
     {
-        /// <summary> 
+        /// <summary>
         ///     True if one of the enabled blockers has <see cref="AirtightComponent.NoAirWhenFullyAirBlocked"/>. Note
         ///     that this does not actually check if all directions are blocked.
         /// </summary>
@@ -321,7 +322,7 @@ public partial class AtmosphereSystem
         (EntityUid Grid, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Handled = false);
 
     [ByRefEvent] private record struct HotspotExposeMethodEvent
-        (EntityUid Grid, Vector2i Tile, float ExposedTemperature, float ExposedVolume, bool soh, bool Handled = false);
+        (EntityUid Grid, EntityUid? SparkSourceUid, Vector2i Tile, float ExposedTemperature, float ExposedVolume, bool soh, bool Handled = false);
 
     [ByRefEvent] private record struct HotspotExtinguishMethodEvent
         (EntityUid Grid, Vector2i Tile, bool Handled = false);
index ff8adaf7024e4fe840956dd55a2a1ed72933f467..935abb29fc495f3f54af9d597cb519217674868b 100644 (file)
@@ -405,7 +405,7 @@ public sealed partial class AtmosphereSystem
         if (!component.Tiles.TryGetValue(args.Tile, out var tile))
             return;
 
-        HotspotExpose(component, tile, args.ExposedTemperature, args.ExposedVolume, args.soh);
+        HotspotExpose(component, tile, args.ExposedTemperature, args.ExposedVolume, args.soh, args.SparkSourceUid);
         args.Handled = true;
     }
 
index 9402d76cdeb00d5eeca05ee2eb8058f41c704fad..575391cdfd50435af7a8172aea8a7ccff20bc134 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Atmos.Components;
 using Content.Server.Atmos.Reactions;
 using Content.Shared.Atmos;
 using Content.Shared.Audio;
+using Content.Shared.Database;
 using Robust.Shared.Audio;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -94,7 +95,8 @@ namespace Content.Server.Atmos.EntitySystems
             // TODO ATMOS Maybe destroy location here?
         }
 
-        private void HotspotExpose(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, float exposedTemperature, float exposedVolume, bool soh = false)
+        private void HotspotExpose(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile,
+            float exposedTemperature, float exposedVolume, bool soh = false, EntityUid? sparkSourceUid = null)
         {
             if (tile.Air == null)
                 return;
@@ -125,6 +127,9 @@ namespace Content.Server.Atmos.EntitySystems
 
             if ((exposedTemperature > Atmospherics.PlasmaMinimumBurnTemperature) && (plasma > 0.5f || tritium > 0.5f))
             {
+                if (sparkSourceUid.HasValue)
+                    _adminLog.Add(LogType.Flammable, LogImpact.High, $"Heat/spark of {ToPrettyString(sparkSourceUid.Value)} caused atmos ignition of gas: {tile.Air.Temperature.ToString():temperature}K - {oxygen}mol Oxygen, {plasma}mol Plasma, {tritium}mol Tritium");
+
                 tile.Hotspot = new Hotspot
                 {
                     Volume = exposedVolume * 25f,
@@ -134,7 +139,6 @@ namespace Content.Server.Atmos.EntitySystems
                     State = 1
                 };
 
-
                 AddActiveTile(gridAtmosphere, tile);
                 gridAtmosphere.HotspotTiles.Add(tile);
             }
index 0a7fa1eaba075efe4768e7e5e650c28cedf24362..f612f1205fab2bdacf00a0528bdb06adf381fe4e 100644 (file)
@@ -321,7 +321,7 @@ namespace Content.Server.Atmos.EntitySystems
                 {
                     _atmosphereSystem.HotspotExpose(transform.GridUid.Value,
                         _transformSystem.GetGridOrMapTilePosition(uid, transform),
-                        700f, 50f, true);
+                        700f, 50f, uid, true);
 
                 }
 
index 19e28038c424665e37f5d74315167e09bfb266ad..9f3b15614e57568c271ed72740261f7cbb238520 100644 (file)
@@ -45,7 +45,7 @@ public sealed class IgnitionSourceSystem : EntitySystem
             if (transform.GridUid is { } gridUid)
             {
                 var position = _transformSystem.GetGridOrMapTilePosition(source, transform);
-                _atmosphereSystem.HotspotExpose(gridUid, position, component.Temperature, 50, true);
+                _atmosphereSystem.HotspotExpose(gridUid, position, component.Temperature, 50, source, true);
             }
         }
 
index a7b241467cbf268c8e6f903a06811aa275cf4b4a..b705fabce43f0a89222e17047599c4526c9e9c74 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Server.Light.EntitySystems
 
                 var position = _transformSystem.GetGridOrMapTilePosition(match.Owner, xform);
 
-                _atmosphereSystem.HotspotExpose(gridUid, position, 400, 50, true);
+                _atmosphereSystem.HotspotExpose(gridUid, position, 400, 50, match.Owner, true);
             }
         }
 
index 15dbde8a26271f32e899122d0369ad20cf1d9fa9..30e24485dcb3f79caf2ed32630b3f7b2e9927b5c 100644 (file)
@@ -112,7 +112,7 @@ namespace Content.Server.Nutrition.EntitySystems
                     if (transform.GridUid is {} gridUid)
                     {
                         var position = _transformSystem.GetGridOrMapTilePosition(uid, transform);
-                        _atmos.HotspotExpose(gridUid, position, smokable.ExposeTemperature, smokable.ExposeVolume, true);
+                        _atmos.HotspotExpose(gridUid, position, smokable.ExposeTemperature, smokable.ExposeVolume, uid, true);
                     }
                 }
 
index 016e145c8b6807e469fd2b9e6241d2ce1588763f..e073ec20f533743704ebb5162f91cc10294e4eb1 100644 (file)
@@ -139,7 +139,7 @@ namespace Content.Server.StationEvents.Events
 
                 // Don't want it to be so obnoxious as to instantly murder anyone in the area but enough that
                 // it COULD start potentially start a bigger fire.
-                _atmosphere.HotspotExpose(_targetGrid, _targetTile, 700f, 50f, true);
+                _atmosphere.HotspotExpose(_targetGrid, _targetTile, 700f, 50f, null, true);
                 SoundSystem.Play("/Audio/Effects/sparks4.ogg", Filter.Pvs(_targetCoords), _targetCoords);
             }
         }
index 19cad83122766fc8ef5abc9abe7d6409937f25b3..743a50263d400c79e08ec3794dae00ced2e90042 100644 (file)
@@ -132,7 +132,7 @@ namespace Content.Server.Tools
             if (transform.GridUid is {} gridUid)
             {
                 var position = _transformSystem.GetGridOrMapTilePosition(uid, transform);
-                _atmosphereSystem.HotspotExpose(gridUid, position, 700, 50, true);
+                _atmosphereSystem.HotspotExpose(gridUid, position, 700, 50, uid, true);
             }
 
             _entityManager.Dirty(welder);