Add atmos ignition logs (#14216)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user