]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix disposals test (#26535)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 29 Mar 2024 16:03:01 +0000 (03:03 +1100)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2024 16:03:01 +0000 (03:03 +1100)
The rounding at 0,0 got memed.

Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs

index 976fc2eceb5aaa981a7857650cc337a30147f5f5..9109fdbe4f7638a4ce6f98bc61713b108814bb4d 100644 (file)
@@ -163,7 +163,6 @@ namespace Content.IntegrationTests.Tests.Disposal
             var entityManager = server.ResolveDependency<IEntityManager>();
             var xformSystem = entityManager.System<SharedTransformSystem>();
             var disposalSystem = entityManager.System<DisposalUnitSystem>();
-
             await server.WaitAssertion(() =>
             {
                 // Spawn the entities
@@ -171,8 +170,7 @@ namespace Content.IntegrationTests.Tests.Disposal
                 human = entityManager.SpawnEntity("HumanDisposalDummy", coordinates);
                 wrench = entityManager.SpawnEntity("WrenchDummy", coordinates);
                 disposalUnit = entityManager.SpawnEntity("DisposalUnitDummy", coordinates);
-                disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy",
-                    entityManager.GetComponent<TransformComponent>(disposalUnit).MapPosition);
+                disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy", coordinates);
 
                 // Test for components existing
                 unitUid = disposalUnit;
@@ -204,10 +202,10 @@ namespace Content.IntegrationTests.Tests.Disposal
 
             await server.WaitAssertion(() =>
             {
-                // Move the disposal trunk away
-                var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
                 var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
-                xformSystem.SetWorldPosition(xform, worldPos + new Vector2(1, 0));
+
+                // Move the disposal trunk away
+                xformSystem.SetWorldPosition(disposalTrunk, worldPos + new Vector2(1, 0));
 
                 // Fail to flush with a mob and an item
                 Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
@@ -215,10 +213,12 @@ namespace Content.IntegrationTests.Tests.Disposal
 
             await server.WaitAssertion(() =>
             {
-                // Move the disposal trunk back
                 var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
-                var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
-                xformSystem.SetWorldPosition(xform, worldPos - new Vector2(1, 0));
+                var worldPos = xformSystem.GetWorldPosition(disposalUnit);
+
+                // Move the disposal trunk back
+                xformSystem.SetWorldPosition(disposalTrunk, worldPos);
+                xformSystem.AnchorEntity((disposalTrunk, xform));
 
                 // Fail to flush with a mob and an item, no power
                 Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
@@ -240,6 +240,7 @@ namespace Content.IntegrationTests.Tests.Disposal
                 // Re-pressurizing
                 Flush(disposalUnit, unitComponent, false, disposalSystem);
             });
+
             await pair.CleanReturnAsync();
         }
     }