diff --git a/Content.Server/ImmovableRod/ImmovableRodComponent.cs b/Content.Server/ImmovableRod/ImmovableRodComponent.cs index fec9a5b382..f8403b5ac8 100644 --- a/Content.Server/ImmovableRod/ImmovableRodComponent.cs +++ b/Content.Server/ImmovableRod/ImmovableRodComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.Sound; +using Content.Shared.Sound; namespace Content.Server.ImmovableRod; @@ -13,12 +13,6 @@ public sealed class ImmovableRodComponent : Component [DataField("hitSoundProbability")] public float HitSoundProbability = 0.1f; - /// - /// The rod will be automatically cleaned up after this time. - /// - [DataField("lifetime")] - public TimeSpan Lifetime = TimeSpan.FromSeconds(30); - [DataField("minSpeed")] public float MinSpeed = 10f; @@ -42,7 +36,4 @@ public sealed class ImmovableRodComponent : Component /// [DataField("destroyTiles")] public bool DestroyTiles = true; - - [DataField("accumulator")] - public float Accumulator = 0f; } diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index d683794671..4889ac31bd 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Body.Components; +using Content.Server.Body.Components; using Content.Server.Popups; using Content.Shared.Examine; using Content.Shared.Popups; @@ -23,14 +23,6 @@ public sealed class ImmovableRodSystem : EntitySystem // we are deliberately including paused entities. rod hungers for all foreach (var (rod, trans) in EntityManager.EntityQuery(true)) { - rod.Accumulator += frameTime; - - if (rod.Accumulator > rod.Lifetime.TotalSeconds) - { - QueueDel(rod.Owner); - return; - } - if (!rod.DestroyTiles) continue; if (!_map.TryGetGrid(trans.GridID, out var grid)) diff --git a/Resources/Prototypes/Entities/Objects/Fun/immovable_rod.yml b/Resources/Prototypes/Entities/Objects/Fun/immovable_rod.yml index 0eebc02258..e9faf6bcd3 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/immovable_rod.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/immovable_rod.yml @@ -13,6 +13,8 @@ state: icon noRot: false - type: ImmovableRod + - type: TimedDespawn + lifetime: 30.0 - type: Physics bodyType: Dynamic linearDamping: 0