]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix radiation system warnings (#37892)
authorTemporalOroboros <TemporalOroboros@gmail.com>
Wed, 28 May 2025 09:34:58 +0000 (02:34 -0700)
committerGitHub <noreply@github.com>
Wed, 28 May 2025 09:34:58 +0000 (11:34 +0200)
* Use SharedMapSystem for GetTileIndices

* Fix formatting errors in Server

* Fix formatting errors in Client

Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs
Content.Server/Radiation/Systems/GeigerSystem.cs
Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs
Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs
Content.Server/Radiation/Systems/RadiationSystem.cs

index 9ec24fae0ef301cc8765e4657c6ba0377690ce0b..d6e36dd0ad4a7f0c0da6e78fe4b6fab287691e12 100644 (file)
@@ -59,7 +59,7 @@ namespace Content.Client.Radiation.Overlays
                 shd?.SetParameter("positionInput", tempCoords);
                 shd?.SetParameter("range", instance.Range);
                 var life = (_gameTiming.RealTime - instance.Start).TotalSeconds / instance.Duration;
-                shd?.SetParameter("life", (float) life);
+                shd?.SetParameter("life", (float)life);
 
                 // There's probably a very good reason not to do this.
                 // Oh well!
index 6cf17c49c83555e30e0354e98fd0758b5381fe9a..77df6c09e21f61dbe857f19a0628c2a3fd9b840f 100644 (file)
@@ -165,8 +165,8 @@ public sealed class GeigerSystem : SharedGeigerSystem
             param = sounds.Params.WithLoop(true).WithVolume(component.Volume + 1.5f).WithMaxDistance(component.BroadcastRange);
             component.Stream = _audio.PlayPvs(sound, uid, param)?.Entity;
         }
-        else if(component.User is not null && _player.TryGetSessionByEntity(component.User.Value, out var session))
-                    component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
+        else if (component.User is not null && _player.TryGetSessionByEntity(component.User.Value, out var session))
+            component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
     }
 
     public static GeigerDangerLevel RadsToLevel(float rads)
index d9683ac259b116e8bdcf3e41b0f9fb989ebd5456..6a6cceb13a149cde93902f80c843c00fe9517b87 100644 (file)
@@ -108,7 +108,7 @@ public partial class RadiationSystem
 
         // save resistance into rad protection grid
         var gridId = trs.GridUid.Value;
-        var tilePos = grid.TileIndicesFor(trs.Coordinates);
+        var tilePos = _maps.TileIndicesFor((trs.GridUid.Value, grid), trs.Coordinates);
         AddToTile(gridId, tilePos, component.RadResistance);
 
         // and remember it as last valid position
index 15e1c352564b82e723b2718f25bda1999c2ff23f..ffcf12b9d8e26bd6eec749c3af51ff9a068da19a 100644 (file)
@@ -74,7 +74,7 @@ public partial class RadiationSystem
             foreach (var source in _sources)
             {
                 // send ray towards destination entity
-                if (Irradiate(source, destUid, destTrs, destWorld, debug) is not {} ray)
+                if (Irradiate(source, destUid, destTrs, destWorld, debug) is not { } ray)
                     continue;
 
                 // add rads to total rad exposure
@@ -156,7 +156,7 @@ public partial class RadiationSystem
         // if source and destination on the same grid it's possible that
         // between them can be another grid (ie. shuttle in center of donut station)
         // however we can do simplification and ignore that case
-        if (GridcastSimplifiedSameGrid && destTrs.GridUid is {} gridUid && source.GridUid == gridUid)
+        if (GridcastSimplifiedSameGrid && destTrs.GridUid is { } gridUid && source.GridUid == gridUid)
         {
             if (!_gridQuery.TryGetComponent(gridUid, out var gridComponent))
                 return ray;
@@ -222,12 +222,12 @@ public partial class RadiationSystem
             : Vector2.Transform(ray.Destination, grid.Comp2.InvLocalMatrix);
 
         Vector2i sourceGrid = new(
-            (int) Math.Floor(srcLocal.X / grid.Comp1.TileSize),
-            (int) Math.Floor(srcLocal.Y / grid.Comp1.TileSize));
+            (int)Math.Floor(srcLocal.X / grid.Comp1.TileSize),
+            (int)Math.Floor(srcLocal.Y / grid.Comp1.TileSize));
 
         Vector2i destGrid = new(
-            (int) Math.Floor(dstLocal.X / grid.Comp1.TileSize),
-            (int) Math.Floor(dstLocal.Y / grid.Comp1.TileSize));
+            (int)Math.Floor(dstLocal.X / grid.Comp1.TileSize),
+            (int)Math.Floor(dstLocal.Y / grid.Comp1.TileSize));
 
         // iterate tiles in grid line from source to destination
         var line = new GridLineEnumerator(sourceGrid, destGrid);
index 7402a72701015e41ec92311ef5cde021d79f60e1..34dbec6f8643dd53e3cd54b20233319764eb6bda 100644 (file)
@@ -14,6 +14,7 @@ public sealed partial class RadiationSystem : EntitySystem
     [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
     [Dependency] private readonly SharedStackSystem _stack = default!;
+    [Dependency] private readonly SharedMapSystem _maps = default!;
 
     private EntityQuery<RadiationBlockingContainerComponent> _blockerQuery;
     private EntityQuery<RadiationGridResistanceComponent> _resistanceQuery;