From 355e044119fb8be423b3ad0547cd5a96799558df Mon Sep 17 00:00:00 2001 From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Mon, 30 May 2022 01:06:50 -0400 Subject: [PATCH] Adds TimedDespawn component to Invisible Walls, nukes DeleteAfterTime (#8528) * Adds TimedDelete component to Invisible Walls * Removes Delete After Time --- .../Delete/DeleteAfterTimeComponent.cs | 15 --------------- Content.Server/Delete/DeleteAfterTimeSystem.cs | 18 ------------------ .../Entities/Structures/Walls/walls.yml | 4 ++-- 3 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 Content.Server/Delete/DeleteAfterTimeComponent.cs delete mode 100644 Content.Server/Delete/DeleteAfterTimeSystem.cs diff --git a/Content.Server/Delete/DeleteAfterTimeComponent.cs b/Content.Server/Delete/DeleteAfterTimeComponent.cs deleted file mode 100644 index 60be4d4cba..0000000000 --- a/Content.Server/Delete/DeleteAfterTimeComponent.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Content.Server.Delete -{ - /// - /// Deletes the entity after the specified period of time. - /// - [RegisterComponent] - public sealed class DeleteAfterTimeComponent : Component - { - [ViewVariables(VVAccess.ReadWrite), DataField("accumulator")] - public float Accumulator = 0f; - - [ViewVariables(VVAccess.ReadWrite), DataField("despawnTime")] - public TimeSpan DespawnTime = TimeSpan.FromSeconds(30); - } -} diff --git a/Content.Server/Delete/DeleteAfterTimeSystem.cs b/Content.Server/Delete/DeleteAfterTimeSystem.cs deleted file mode 100644 index 52ff0262d5..0000000000 --- a/Content.Server/Delete/DeleteAfterTimeSystem.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Content.Server.Delete; - -public sealed class DeleteAfterTimeSystem : EntitySystem -{ - public override void Update(float frameTime) - { - base.Update(frameTime); - - foreach (var comp in EntityQuery()) - { - comp.Accumulator += frameTime; - if (comp.Accumulator < comp.DespawnTime.TotalSeconds) - continue; - - QueueDel(comp.Owner); - } - } -} diff --git a/Resources/Prototypes/Entities/Structures/Walls/walls.yml b/Resources/Prototypes/Entities/Structures/Walls/walls.yml index efb0286889..7ea90e3d5a 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/walls.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/walls.yml @@ -697,8 +697,8 @@ id: WallInvisible name: Invisible Wall components: - - type: DeleteAfterTime - despawnTime: 30 + - type: TimedDespawn + lifetime: 30 - type: Tag tags: - Wall