Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void ProcessHotspot(
ExcitedGroupResetCooldowns(tile.ExcitedGroup);

// If the hotspot is too weak to exist/doesn't have the correct conditions, yeet it for deletion at the end of the tick
if ((tile.Hotspot.Temperature < Atmospherics.FireMinimumTemperatureToExist) || (tile.Hotspot.Volume <= 1f)
if ((tile.Hotspot.Temperature < Atmospherics.FireMinimumTemperatureToExist) || (tile.Hotspot.Volume <= 1f && tile.PuddleSolutionFlammability == 0) // Forge-Change
|| tile.Air == null || tile.Air.GetMoles(Gas.Oxygen) < 0.5f || (tile.Air.GetMoles(Gas.Plasma) < 0.5f && tile.Air.GetMoles(Gas.Tritium) < 0.5f) && tile.PuddleSolutionFlammability == 0)
{
tile.Hotspot = new Hotspot();
Expand All @@ -61,6 +61,21 @@ private void ProcessHotspot(

PerformHotspotExposure(tile);

// Forge-change-start
// Fuel may have been fully consumed during exposure; extinguish immediately instead of waiting a tick.
var air = tile.Air;
if (air != null
&& air.GetMoles(Gas.Plasma) < 0.5f
&& air.GetMoles(Gas.Tritium) < 0.5f
&& tile.PuddleSolutionFlammability == 0)
{
tile.Hotspot = new Hotspot();
tile.Hotspot.Type = HotspotType.Gas;
InvalidateVisuals(ent, tile);
return;
}
// Forge-change-end

tile.Hotspot.Type = tile.PuddleSolutionFlammability > 0 ? HotspotType.Puddle : HotspotType.Gas;

if (tile.Hotspot.Bypassing || tile.PuddleSolutionFlammability > 0)
Expand Down Expand Up @@ -91,9 +106,9 @@ private void ProcessHotspot(
if (tileBurntDecals < 4)
_decalSystem.TryAddDecal(_burntDecals[_random.Next(_burntDecals.Length)], new EntityCoordinates(gridUid, tilePos), out _, cleanable: true);

if (tile.Air.Temperature > Atmospherics.FireMinimumTemperatureToSpread)
if (air != null && air.Temperature > Atmospherics.FireMinimumTemperatureToSpread) // Forge-Change
{
var radiatedTemperature = tile.Air.Temperature * Atmospherics.FireSpreadRadiosityScale;
var radiatedTemperature = air.Temperature * Atmospherics.FireSpreadRadiosityScale; // Forge-Change
foreach (var otherTile in tile.AdjacentTiles)
{
// TODO ATMOS: This is sus. Suss this out.
Expand Down Expand Up @@ -223,6 +238,15 @@ private void PerformHotspotExposure(TileAtmosphere tile)
{
RaiseLocalEvent(entity, ref fireEvent);
}

// Forge-change-start
// Puddle fires don't produce gas fire reaction results; sustain volume and temperature from fuel.
if (tile.PuddleSolutionFlammability > 0)
{
tile.Hotspot.Temperature = MathF.Max(tile.Hotspot.Temperature, Atmospherics.FireMinimumTemperatureToExist);
tile.Hotspot.Volume = MathF.Max(tile.Hotspot.Volume, tile.PuddleSolutionFlammability * 25f);
}
// Forge-change-end
}

/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions Content.Server/Fluids/EntitySystems/PuddleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public override void Initialize()

// Shouldn't need re-anchoring.
SubscribeLocalEvent<PuddleComponent, AnchorStateChangedEvent>(OnAnchorChanged);
SubscribeLocalEvent<PuddleComponent, ComponentShutdown>(OnPuddleShutdown); // Forge-Change
SubscribeLocalEvent<PuddleComponent, SolutionContainerChangedEvent>(OnSolutionUpdate);
SubscribeLocalEvent<PuddleComponent, SpreadNeighborsEvent>(OnPuddleSpread);
SubscribeLocalEvent<PuddleComponent, SlipEvent>(OnPuddleSlip);
Expand Down Expand Up @@ -288,6 +289,7 @@ private void OnSolutionUpdate(Entity<PuddleComponent> entity, ref SolutionContai

if (args.Solution.Volume <= 0)
{
UpdateFlammability((entity.Owner, entity.Comp), null); // Forge-Change
_deletionQueue.Add(entity);
return;
}
Expand Down Expand Up @@ -463,8 +465,18 @@ private void UpdateSlow(EntityUid uid, Solution solution)
private void OnAnchorChanged(Entity<PuddleComponent> entity, ref AnchorStateChangedEvent args)
{
if (!args.Anchored)
// Forge-change-start
{
UpdateFlammability((entity.Owner, entity.Comp), null);
QueueDel(entity);
}
}

private void OnPuddleShutdown(Entity<PuddleComponent> entity, ref ComponentShutdown args)
{
UpdateFlammability((entity.Owner, entity.Comp), null);
}
// Forge-change-end

/// <summary>
/// Gets the current volume of the given puddle, which may not necessarily be PuddleVolume.
Expand Down
Loading