]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix GravityGridTest (#23348)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Tue, 2 Jan 2024 06:24:01 +0000 (01:24 -0500)
committerGitHub <noreply@github.com>
Tue, 2 Jan 2024 06:24:01 +0000 (17:24 +1100)
Content.IntegrationTests/Tests/GravityGridTest.cs
Content.Shared/Coordinates/EntityCoordinatesExtensions.cs

index 22218a097a25084a4c962bf4042b50b3ff39d773..7f817e8a1e0e1af928ae7bb0051de1655e5fc6ea 100644 (file)
@@ -1,11 +1,10 @@
 using Content.Server.Gravity;
 using Content.Server.Power.Components;
-using Content.Shared.Coordinates;
 using Content.Shared.Gravity;
 using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Maths;
 
 namespace Content.IntegrationTests.Tests
 {
@@ -38,6 +37,7 @@ namespace Content.IntegrationTests.Tests
             EntityUid generator = default;
             var entityMan = server.ResolveDependency<IEntityManager>();
             var mapMan = server.ResolveDependency<IMapManager>();
+            var mapSys = entityMan.System<SharedMapSystem>();
 
             MapGridComponent grid1 = null;
             MapGridComponent grid2 = null;
@@ -53,7 +53,10 @@ namespace Content.IntegrationTests.Tests
                 grid1Entity = grid1.Owner;
                 grid2Entity = grid2.Owner;
 
-                generator = entityMan.SpawnEntity("GridGravityGeneratorDummy", grid2.ToCoordinates());
+                mapSys.SetTile(grid1Entity, grid1, Vector2i.Zero, new Tile(1));
+                mapSys.SetTile(grid2Entity, grid2, Vector2i.Zero, new Tile(1));
+
+                generator = entityMan.SpawnEntity("GridGravityGeneratorDummy", new EntityCoordinates(grid1Entity, 0.5f, 0.5f));
                 Assert.Multiple(() =>
                 {
                     Assert.That(entityMan.HasComponent<GravityGeneratorComponent>(generator));
index 2aadbf8a81c8d1459f07eb8adabf942f10028742..b9083eabe1918d46b34220136be6884b37690c11 100644 (file)
@@ -21,11 +21,13 @@ namespace Content.Shared.Coordinates
             return new EntityCoordinates(id, x, y);
         }
 
+        [Obsolete]
         public static EntityCoordinates ToCoordinates(this MapGridComponent grid, float x, float y)
         {
             return ToCoordinates(grid.Owner, x, y);
         }
 
+        [Obsolete]
         public static EntityCoordinates ToCoordinates(this MapGridComponent grid)
         {
             return ToCoordinates(grid.Owner, Vector2.Zero);