From 3f9102839579506e8bf71f5fbf48c92328104e58 Mon Sep 17 00:00:00 2001 From: qwerltaz <69696513+qwerltaz@users.noreply.github.com> Date: Thu, 28 Dec 2023 04:05:50 +0100 Subject: [PATCH] Fix flammables air ignition (#23063) * Fix welder ignition * fix mobs on fire hotspot expose frequency * fix shotgun pellets ignition * ensure ignitionComp on flammable init * \n * Revert "ensure ignitionComp on flammable init" This reverts commit 6915dcdc --- .../Atmos/EntitySystems/FlammableSystem.cs | 13 ++++++------- .../IgnitionSource/IgnitionSourceComponent.cs | 4 ++-- Content.Server/Tools/ToolSystem.Welder.cs | 6 ++++++ .../Prototypes/Entities/Objects/Misc/torch.yml | 2 +- .../Weapons/Guns/Ammunition/Projectiles/shotgun.yml | 3 +++ 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 36722884e5..a970ef564a 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Administration.Logs; using Content.Server.Atmos.Components; using Content.Server.Explosion.EntitySystems; +using Content.Server.IgnitionSource; using Content.Server.Stunnable; using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; @@ -35,6 +36,7 @@ namespace Content.Server.Atmos.EntitySystems [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; [Dependency] private readonly StunSystem _stunSystem = default!; [Dependency] private readonly TemperatureSystem _temperatureSystem = default!; + [Dependency] private readonly IgnitionSourceSystem _ignitionSourceSystem = default!; [Dependency] private readonly DamageableSystem _damageableSystem = default!; [Dependency] private readonly AlertsSystem _alertsSystem = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; @@ -285,6 +287,8 @@ namespace Content.Server.Atmos.EntitySystems flammable.OnFire = false; flammable.FireStacks = 0; + _ignitionSourceSystem.SetIgnited(uid, false); + UpdateAppearance(uid, flammable); } @@ -403,13 +407,8 @@ namespace Content.Server.Atmos.EntitySystems continue; } - if(transform.GridUid != null) - { - _atmosphereSystem.HotspotExpose(transform.GridUid.Value, - _transformSystem.GetGridOrMapTilePosition(uid, transform), - 700f, 50f, uid, true); - - } + EnsureComp(uid); + _ignitionSourceSystem.SetIgnited(uid); } } } diff --git a/Content.Server/IgnitionSource/IgnitionSourceComponent.cs b/Content.Server/IgnitionSource/IgnitionSourceComponent.cs index 6b6a16000f..d6e0ab9407 100644 --- a/Content.Server/IgnitionSource/IgnitionSourceComponent.cs +++ b/Content.Server/IgnitionSource/IgnitionSourceComponent.cs @@ -9,6 +9,6 @@ public sealed partial class IgnitionSourceComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public bool Ignited; - [DataField(required: true), ViewVariables(VVAccess.ReadWrite)] - public int Temperature; + [DataField, ViewVariables(VVAccess.ReadWrite)] + public int Temperature = 700; } diff --git a/Content.Server/Tools/ToolSystem.Welder.cs b/Content.Server/Tools/ToolSystem.Welder.cs index 7827cbdfc5..f4eca32a3d 100644 --- a/Content.Server/Tools/ToolSystem.Welder.cs +++ b/Content.Server/Tools/ToolSystem.Welder.cs @@ -1,5 +1,6 @@ using System.Linq; using Content.Server.Chemistry.Components; +using Content.Server.IgnitionSource; using Content.Server.Tools.Components; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Database; @@ -17,6 +18,7 @@ namespace Content.Server.Tools public sealed partial class ToolSystem { [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; + [Dependency] private readonly IgnitionSourceSystem _ignitionSource = default!; private readonly HashSet _activeWelders = new(); private const float WelderUpdateTimer = 1f; @@ -68,6 +70,8 @@ namespace Content.Server.Tools // Logging _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(args.User):user} toggled {ToPrettyString(uid):welder} on"); + _ignitionSource.SetIgnited(uid); + if (transform.GridUid is { } gridUid) { var position = _transformSystem.GetGridOrMapTilePosition(uid, transform); @@ -84,6 +88,8 @@ namespace Content.Server.Tools // Logging _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(args.User):user} toggled {ToPrettyString(uid):welder} off"); + _ignitionSource.SetIgnited(uid, false); + Dirty(uid, welder); _activeWelders.Remove(uid); diff --git a/Resources/Prototypes/Entities/Objects/Misc/torch.yml b/Resources/Prototypes/Entities/Objects/Misc/torch.yml index 3ee1a7a4cd..0efb753e0d 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/torch.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/torch.yml @@ -1,5 +1,5 @@ - type: entity - name: torch # todo: we need some sort of IgnitionSourceComponent we can add to this, so when it's lit it will cause fires when touching fuel + name: torch parent: BaseItem id: Torch description: A torch fashioned from some wood. diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index a9ea6dc7d1..f92828ba0b 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -56,6 +56,8 @@ types: Blunt: 1 Heat: 7 + - type: IgnitionSource + ignited: true - type: entity id: PelletShotgunPractice @@ -142,6 +144,7 @@ sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi state: buckshot-flare - type: IgnitionSource + ignited: true temperature: 1000 - type: TimedDespawn lifetime: 240 -- 2.51.2