Convert "IgnoreWeatherComponent" into "BlockWeatherComponent" (#26135)
* ignore * doc
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
description: Yep, it's a tree.
|
||||
abstract: true
|
||||
components:
|
||||
- type: IgnoreWeather
|
||||
- type: SpriteFade
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
key: walls
|
||||
mode: NoSprite
|
||||
- type: Occluder
|
||||
- type: BlockWeather
|
||||
|
||||
- type: entity
|
||||
parent: BaseMaterialDoor
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
- type: ContainerContainer
|
||||
containers:
|
||||
battery-container: !type:Container
|
||||
- type: BlockWeather
|
||||
|
||||
- type: entity
|
||||
id: BaseSecretDoorAssembly
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
messagePerceivedByOthers: comp-window-knock
|
||||
interactSuccessSound:
|
||||
path: /Audio/Effects/glass_knock.ogg
|
||||
- type: BlockWeather
|
||||
|
||||
- type: entity
|
||||
id: ShuttersNormal
|
||||
|
||||
@@ -68,3 +68,4 @@
|
||||
- type: Construction
|
||||
graph: Bookshelf
|
||||
node: bookshelf
|
||||
- type: BlockWeather
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
price: 75
|
||||
- type: RadiationBlocker
|
||||
resistance: 2
|
||||
- type: BlockWeather
|
||||
|
||||
- type: entity
|
||||
parent: BaseWall
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
sprite: Structures/Windows/cracks.rsi
|
||||
- type: StaticPrice
|
||||
price: 100
|
||||
- type: BlockWeather
|
||||
|
||||
- type: entity
|
||||
id: WindowDirectional
|
||||
|
||||
Reference in New Issue
Block a user