From f3e67b05b8c00fd36d441d3a4d749b33f95f5463 Mon Sep 17 00:00:00 2001 From: Ilya Zuev Date: Wed, 15 Jul 2026 18:52:04 +0300 Subject: [PATCH] Fix fire from puddles --- .../EntitySystems/AtmosphereSystem.Hotspot.cs | 30 +++++++++++++++++-- .../Fluids/EntitySystems/PuddleSystem.cs | 12 ++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs index de01d681813..cadabacfdf5 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs @@ -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(); @@ -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) @@ -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. @@ -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 } /// diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index d63ba937fbd..c580034beab 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -93,6 +93,7 @@ public override void Initialize() // Shouldn't need re-anchoring. SubscribeLocalEvent(OnAnchorChanged); + SubscribeLocalEvent(OnPuddleShutdown); // Forge-Change SubscribeLocalEvent(OnSolutionUpdate); SubscribeLocalEvent(OnPuddleSpread); SubscribeLocalEvent(OnPuddleSlip); @@ -288,6 +289,7 @@ private void OnSolutionUpdate(Entity entity, ref SolutionContai if (args.Solution.Volume <= 0) { + UpdateFlammability((entity.Owner, entity.Comp), null); // Forge-Change _deletionQueue.Add(entity); return; } @@ -463,8 +465,18 @@ private void UpdateSlow(EntityUid uid, Solution solution) private void OnAnchorChanged(Entity entity, ref AnchorStateChangedEvent args) { if (!args.Anchored) + // Forge-change-start + { + UpdateFlammability((entity.Owner, entity.Comp), null); QueueDel(entity); + } + } + + private void OnPuddleShutdown(Entity entity, ref ComponentShutdown args) + { + UpdateFlammability((entity.Owner, entity.Comp), null); } + // Forge-change-end /// /// Gets the current volume of the given puddle, which may not necessarily be PuddleVolume.