Convert "IgnoreWeatherComponent" into "BlockWeatherComponent" (#26135)

* ignore

* doc
This commit is contained in:
Ed
2024-03-16 01:36:09 +03:00
committed by GitHub
parent 3425444c53
commit 4aa72af574
10 changed files with 12 additions and 11 deletions

View File

@@ -3,10 +3,10 @@ using Robust.Shared.GameStates;
namespace Content.Shared.Weather;
/// <summary>
/// This entity will be ignored for considering weather on a tile
/// This entity will block the weather if it's anchored to the floor.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class IgnoreWeatherComponent : Component
public sealed partial class BlockWeatherComponent : Component
{
}

View File

@@ -19,13 +19,13 @@ public abstract class SharedWeatherSystem : EntitySystem
[Dependency] private readonly MetaDataSystem _metadata = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
private EntityQuery<IgnoreWeatherComponent> _ignoreQuery;
private EntityQuery<BlockWeatherComponent> _blockQuery;
private EntityQuery<PhysicsComponent> _physicsQuery;
public override void Initialize()
{
base.Initialize();
_ignoreQuery = GetEntityQuery<IgnoreWeatherComponent>();
_blockQuery = GetEntityQuery<BlockWeatherComponent>();
_physicsQuery = GetEntityQuery<PhysicsComponent>();
SubscribeLocalEvent<WeatherComponent, EntityUnpausedEvent>(OnWeatherUnpaused);
}
@@ -57,14 +57,9 @@ public abstract class SharedWeatherSystem : EntitySystem
while (anchoredEnts.MoveNext(out var ent))
{
if (!_ignoreQuery.HasComponent(ent.Value) &&
_physicsQuery.TryGetComponent(ent, out var body) &&
body.Hard &&
body.CanCollide)
{
if (_blockQuery.HasComponent(ent.Value))
return false;
}
}
return true;

View File

@@ -38,7 +38,6 @@
description: Yep, it's a tree.
abstract: true
components:
- type: IgnoreWeather
- type: SpriteFade
- type: Clickable
- type: Sprite

View File

@@ -147,6 +147,7 @@
- Airlock
# This tag is used to nagivate the Airlock construction graph. It's needed because the construction graph is shared between Airlock, AirlockGlass, and HighSecDoor
- type: PryUnpowered
- type: BlockWeather
placement:
mode: SnapgridCenter

View File

@@ -56,6 +56,7 @@
key: walls
mode: NoSprite
- type: Occluder
- type: BlockWeather
- type: entity
parent: BaseMaterialDoor

View File

@@ -64,6 +64,7 @@
- type: ContainerContainer
containers:
battery-container: !type:Container
- type: BlockWeather
- type: entity
id: BaseSecretDoorAssembly

View File

@@ -97,6 +97,7 @@
messagePerceivedByOthers: comp-window-knock
interactSuccessSound:
path: /Audio/Effects/glass_knock.ogg
- type: BlockWeather
- type: entity
id: ShuttersNormal

View File

@@ -68,3 +68,4 @@
- type: Construction
graph: Bookshelf
node: bookshelf
- type: BlockWeather

View File

@@ -49,6 +49,7 @@
price: 75
- type: RadiationBlocker
resistance: 2
- type: BlockWeather
- type: entity
parent: BaseWall

View File

@@ -88,6 +88,7 @@
sprite: Structures/Windows/cracks.rsi
- type: StaticPrice
price: 100
- type: BlockWeather
- type: entity
id: WindowDirectional