diff --git a/Content.Server/Anomaly/Effects/PyroclasticAnomalySystem.cs b/Content.Server/Anomaly/Effects/PyroclasticAnomalySystem.cs index 8e656a58c8..5d86c31f46 100644 --- a/Content.Server/Anomaly/Effects/PyroclasticAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/PyroclasticAnomalySystem.cs @@ -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); } } } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs index 06cfe5cad6..03a07a2e5f 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs @@ -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) { - /// + /// /// True if one of the enabled blockers has . Note /// that this does not actually check if all directions are blocked. /// @@ -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); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs index ff8adaf702..935abb29fc 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs @@ -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; } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs index 9402d76cde..575391cdfd 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs @@ -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); } diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 0a7fa1eaba..f612f1205f 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -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); } diff --git a/Content.Server/IgnitionSource/IgnitionSourceSystem.cs b/Content.Server/IgnitionSource/IgnitionSourceSystem.cs index 19e28038c4..9f3b15614e 100644 --- a/Content.Server/IgnitionSource/IgnitionSourceSystem.cs +++ b/Content.Server/IgnitionSource/IgnitionSourceSystem.cs @@ -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); } } diff --git a/Content.Server/Light/EntitySystems/MatchstickSystem.cs b/Content.Server/Light/EntitySystems/MatchstickSystem.cs index a7b241467c..b705fabce4 100644 --- a/Content.Server/Light/EntitySystems/MatchstickSystem.cs +++ b/Content.Server/Light/EntitySystems/MatchstickSystem.cs @@ -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); } } diff --git a/Content.Server/Nutrition/EntitySystems/SmokingSystem.cs b/Content.Server/Nutrition/EntitySystems/SmokingSystem.cs index 15dbde8a26..30e24485dc 100644 --- a/Content.Server/Nutrition/EntitySystems/SmokingSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/SmokingSystem.cs @@ -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); } } diff --git a/Content.Server/StationEvents/Events/GasLeak.cs b/Content.Server/StationEvents/Events/GasLeak.cs index 016e145c8b..e073ec20f5 100644 --- a/Content.Server/StationEvents/Events/GasLeak.cs +++ b/Content.Server/StationEvents/Events/GasLeak.cs @@ -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); } } diff --git a/Content.Server/Tools/ToolSystem.Welder.cs b/Content.Server/Tools/ToolSystem.Welder.cs index 19cad83122..743a50263d 100644 --- a/Content.Server/Tools/ToolSystem.Welder.cs +++ b/Content.Server/Tools/ToolSystem.Welder.cs @@ -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);