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
{
}
[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);
}
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;