diff --git a/Content.Server/White/AspectsSystem/Aspects/CatEarsAspect.cs b/Content.Server/White/AspectsSystem/Aspects/CatEarsAspect.cs index 845f76862e..2ec670a52c 100644 --- a/Content.Server/White/AspectsSystem/Aspects/CatEarsAspect.cs +++ b/Content.Server/White/AspectsSystem/Aspects/CatEarsAspect.cs @@ -37,7 +37,7 @@ public sealed class CatEarsAspect : AspectSystem private void HandleLateJoin(PlayerSpawnCompleteEvent ev) { - var query = EntityQueryEnumerator(); + var query = EntityQueryEnumerator(); while (query.MoveNext(out var ruleEntity, out _, out var gameRule)) { if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule)) diff --git a/Content.Server/White/AspectsSystem/Aspects/SkeletonAspect.cs b/Content.Server/White/AspectsSystem/Aspects/SkeletonAspect.cs index 57e3bbd8eb..38b02dcf53 100644 --- a/Content.Server/White/AspectsSystem/Aspects/SkeletonAspect.cs +++ b/Content.Server/White/AspectsSystem/Aspects/SkeletonAspect.cs @@ -46,7 +46,7 @@ public sealed class SkeletonAspect : AspectSystem private void HandleLateJoin(PlayerSpawnCompleteEvent ev) { - var query = EntityQueryEnumerator(); + var query = EntityQueryEnumerator(); while (query.MoveNext(out var ruleEntity, out _, out var gameRule)) { if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule)) diff --git a/Content.Server/White/AspectsSystem/Aspects/WindowLeakAspect.cs b/Content.Server/White/AspectsSystem/Aspects/WindowLeakAspect.cs index c0dbe0e5bb..b77b56e933 100644 --- a/Content.Server/White/AspectsSystem/Aspects/WindowLeakAspect.cs +++ b/Content.Server/White/AspectsSystem/Aspects/WindowLeakAspect.cs @@ -3,12 +3,15 @@ using Content.Server.White.AspectsSystem.Aspects.Components; using Content.Server.White.AspectsSystem.Base; using Content.Server.White.Other; using Content.Shared.Coordinates.Helpers; +using Content.Shared.Tag; using Robust.Shared.Map; namespace Content.Server.White.AspectsSystem.Aspects; public sealed class WindowLeakAspect : AspectSystem { + [Dependency] private readonly TagSystem _tag = default!; + protected override void Started(EntityUid uid, WindowLeakAspectComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) { @@ -16,23 +19,20 @@ public sealed class WindowLeakAspect : AspectSystem HashSet coordinatesSet = new(); - var query = EntityQuery(); - foreach (var (window, windowXform) in query) + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var ent, out var window, out var windowXform)) { var coords = windowXform.Coordinates; coordinatesSet.Add(coords); - var wall = EntityManager.SpawnEntity(window.ReplacementProto, coords.SnapToGrid(EntityManager)); - EnsureComp(wall); + EntityManager.DeleteEntity(ent); + EntityManager.SpawnEntity(window.ReplacementProto, coords.SnapToGrid(EntityManager)); } var xformQuery = EntityQueryEnumerator(); while (xformQuery.MoveNext(out var tileEnt, out var xform)) { - if (HasComp(tileEnt)) - continue; - - if (coordinatesSet.Contains(xform.Coordinates)) + if (coordinatesSet.Contains(xform.Coordinates) && _tag.HasTag(tileEnt, "DeleteWithWindows")) EntityManager.DeleteEntity(tileEnt); } } diff --git a/Resources/Prototypes/Entities/Structures/Decoration/curtains.yml b/Resources/Prototypes/Entities/Structures/Decoration/curtains.yml index ed35fb0110..5e9bbb3c83 100644 --- a/Resources/Prototypes/Entities/Structures/Decoration/curtains.yml +++ b/Resources/Prototypes/Entities/Structures/Decoration/curtains.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: HospitalCurtains parent: BaseStructure name: curtains @@ -56,6 +56,9 @@ MaterialCloth1: min: 1 max: 2 + - type: Tag + tags: + - DeleteWithWindows placement: mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml b/Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml index 85cf7240fd..65c1385a30 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml @@ -96,6 +96,9 @@ interactSuccessSound: path: /Audio/Effects/glass_knock.ogg - type: ReflectAspectMark + - type: Tag + tags: + - DeleteWithWindows - type: entity id: ShuttersNormal diff --git a/Resources/Prototypes/Entities/Structures/Walls/grille.yml b/Resources/Prototypes/Entities/Structures/Walls/grille.yml index 1d9e0b3a5c..61b0b64f31 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/grille.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/grille.yml @@ -12,6 +12,7 @@ - type: Tag tags: - RCDDeconstructWhitelist + - DeleteWithWindows - type: CanBuildWindowOnTop - type: Sprite drawdepth: Walls @@ -103,6 +104,7 @@ - type: Tag tags: - RCDDeconstructWhitelist + - DeleteWithWindows - type: Construction graph: Grille node: grilleBroken diff --git a/Resources/Prototypes/White/tags.yml b/Resources/Prototypes/White/tags.yml index abf29d6054..ca8ed97f0e 100644 --- a/Resources/Prototypes/White/tags.yml +++ b/Resources/Prototypes/White/tags.yml @@ -36,3 +36,6 @@ - type: Tag id: Plushie + +- type: Tag + id: DeleteWithWindows