]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix flammables air ignition (#23063)
authorqwerltaz <69696513+qwerltaz@users.noreply.github.com>
Thu, 28 Dec 2023 03:05:50 +0000 (04:05 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Dec 2023 03:05:50 +0000 (20:05 -0700)
* 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

Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Content.Server/IgnitionSource/IgnitionSourceComponent.cs
Content.Server/Tools/ToolSystem.Welder.cs
Resources/Prototypes/Entities/Objects/Misc/torch.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml

index 36722884e57c0e6bdf4332cbee100b36831169ef..a970ef564a1e9fb97db827ff9cf2c598a13a6728 100644 (file)
@@ -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<IgnitionSourceComponent>(uid);
+                _ignitionSourceSystem.SetIgnited(uid);
             }
         }
     }
index 6b6a16000f949d05c130922e7c2d7af80091b2da..d6e0ab9407dcf936398065cdfd7de60462eb4090 100644 (file)
@@ -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;
 }
index 7827cbdfc549f8c57aa091ececcac4dc6c31e7d2..f4eca32a3da6f3c14b2083b3a47c80e9fe791c90 100644 (file)
@@ -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<EntityUid> _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);
index 3ee1a7a4cdf599b24c0c9f529e5ee1d86f8edd48..0efb753e0da384945a37d52db1ee8ff83694b747 100644 (file)
@@ -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.
index a9ea6dc7d14758249a022a9766fc0802526880de..f92828ba0bd869857ea8f09abb026433514eeb3c 100644 (file)
@@ -56,6 +56,8 @@
       types:
         Blunt: 1
         Heat: 7
+  - type: IgnitionSource
+    ignited: true
 
 - type: entity
   id: PelletShotgunPractice
     sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi
     state: buckshot-flare
   - type: IgnitionSource
+    ignited: true
     temperature: 1000
   - type: TimedDespawn
     lifetime: 240