Fix aspects (#500)

This commit is contained in:
Aviu00
2023-10-20 04:40:43 +09:00
committed by Aviu00
parent ecf3ecad81
commit e33472745f
7 changed files with 22 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ public sealed class CatEarsAspect : AspectSystem<CatEarsAspectComponent>
private void HandleLateJoin(PlayerSpawnCompleteEvent ev)
{
var query = EntityQueryEnumerator<RandomAppearanceAspectComponent, GameRuleComponent>();
var query = EntityQueryEnumerator<CatEarsAspectComponent, GameRuleComponent>();
while (query.MoveNext(out var ruleEntity, out _, out var gameRule))
{
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))

View File

@@ -46,7 +46,7 @@ public sealed class SkeletonAspect : AspectSystem<SkeletonAspectComponent>
private void HandleLateJoin(PlayerSpawnCompleteEvent ev)
{
var query = EntityQueryEnumerator<RandomAccentAspectComponent, GameRuleComponent>();
var query = EntityQueryEnumerator<SkeletonAspectComponent, GameRuleComponent>();
while (query.MoveNext(out var ruleEntity, out _, out var gameRule))
{
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))

View File

@@ -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<WindowLeakAspectComponent>
{
[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<WindowLeakAspectComponent>
HashSet<EntityCoordinates> coordinatesSet = new();
var query = EntityQuery<WindowMarkComponent, TransformComponent>();
foreach (var (window, windowXform) in query)
var query = EntityQueryEnumerator<WindowMarkComponent, TransformComponent>();
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<WallMarkComponent>(wall);
EntityManager.DeleteEntity(ent);
EntityManager.SpawnEntity(window.ReplacementProto, coords.SnapToGrid(EntityManager));
}
var xformQuery = EntityQueryEnumerator<TransformComponent>();
while (xformQuery.MoveNext(out var tileEnt, out var xform))
{
if (HasComp<WallMarkComponent>(tileEnt))
continue;
if (coordinatesSet.Contains(xform.Coordinates))
if (coordinatesSet.Contains(xform.Coordinates) && _tag.HasTag(tileEnt, "DeleteWithWindows"))
EntityManager.DeleteEntity(tileEnt);
}
}

View File

@@ -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

View File

@@ -96,6 +96,9 @@
interactSuccessSound:
path: /Audio/Effects/glass_knock.ogg
- type: ReflectAspectMark
- type: Tag
tags:
- DeleteWithWindows
- type: entity
id: ShuttersNormal

View File

@@ -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

View File

@@ -36,3 +36,6 @@
- type: Tag
id: Plushie
- type: Tag
id: DeleteWithWindows