]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Convert "IgnoreWeatherComponent" into "BlockWeatherComponent" (#26135)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Fri, 15 Mar 2024 22:36:09 +0000 (01:36 +0300)
committerGitHub <noreply@github.com>
Fri, 15 Mar 2024 22:36:09 +0000 (18:36 -0400)
* ignore

* doc

Content.Shared/Weather/BlockWeatherComponent.cs [moved from Content.Shared/Weather/IgnoreWeatherComponent.cs with 51% similarity]
Content.Shared/Weather/SharedWeatherSystem.cs
Resources/Prototypes/Entities/Objects/Decoration/flora.yml
Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml
Resources/Prototypes/Entities/Structures/Doors/MaterialDoors/material_doors.yml
Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml
Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml
Resources/Prototypes/Entities/Structures/Furniture/bookshelf.yml
Resources/Prototypes/Entities/Structures/Walls/walls.yml
Resources/Prototypes/Entities/Structures/Windows/window.yml

similarity index 51%
rename from Content.Shared/Weather/IgnoreWeatherComponent.cs
rename to Content.Shared/Weather/BlockWeatherComponent.cs
index 8b8d004ee2a878339deeaca088a72e0d4d8efb12..2ca8ba1aaacd41247b565a8cdbc9e8060739992f 100644 (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
 {
 
 }
index c907137d840a198422433be3e31d14226e1b5d0d..45a2afe7cd980fd9979720fa63e01ab46f2dc45d 100644 (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,13 +57,8 @@ 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;
index a2dda827be71ac76fb9018e2dc4c6f82273e6237..f35d222d39ccbe0f27ef63ffa2e75c1b0be986d6 100644 (file)
@@ -38,7 +38,6 @@
   description: Yep, it's a tree.
   abstract: true
   components:
-  - type: IgnoreWeather
   - type: SpriteFade
   - type: Clickable
   - type: Sprite
index a185d453533b6eed376232543e9923d7e39efa86..5fca0819984247d5929f71bad730d79e05b37949 100644 (file)
       - 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
 
index d3b8521a9bc91722d03e625946f856dcdad22d49..4b6f72de934b17c34d13b03f4c9fbe78ad74565a 100644 (file)
@@ -56,6 +56,7 @@
     key: walls
     mode: NoSprite
   - type: Occluder
+  - type: BlockWeather
 
 - type: entity
   parent: BaseMaterialDoor
index 154467213a74c9b95ff5d47d7a41fc05b4a21961..2c54d3cd41875e10adff4746242651cd83eb24c8 100644 (file)
@@ -64,6 +64,7 @@
   - type: ContainerContainer
     containers:
       battery-container: !type:Container
+  - type: BlockWeather
 
 - type: entity
   id: BaseSecretDoorAssembly
index 87fd8ef0106ba79bdfc55e84fd499170d5364fcd..e38ba1fd6674a8f3eaf8081ff31056d0cde6223b 100644 (file)
@@ -97,6 +97,7 @@
     messagePerceivedByOthers: comp-window-knock
     interactSuccessSound:
       path: /Audio/Effects/glass_knock.ogg
+  - type: BlockWeather
 
 - type: entity
   id: ShuttersNormal
index 86f6719f77ed24a3ba14fc2282ac61346cb72b83..792f0766799ebf99bdb0bdad21b38ba0fdf90cc4 100644 (file)
@@ -68,3 +68,4 @@
   - type: Construction
     graph: Bookshelf
     node: bookshelf
+  - type: BlockWeather
index 3add2062954892ee8bed19f45a0c70ccc44c73fb..f06c0fc42445b7fe9f15fc41bee4f195b7b2bb77 100644 (file)
@@ -49,6 +49,7 @@
     price: 75
   - type: RadiationBlocker
     resistance: 2
+  - type: BlockWeather
 
 - type: entity
   parent: BaseWall
index 750a26bcf1e8a40a3d027878a21aa31b48c2f42b..375d0c16aedda8e24fc6d79f81160fc290d8134f 100644 (file)
@@ -88,6 +88,7 @@
       sprite: Structures/Windows/cracks.rsi
   - type: StaticPrice
     price: 100
+  - type: BlockWeather
 
 - type: entity
   id: WindowDirectional