Fix disposals test (#26535)

The rounding at 0,0 got memed.
This commit is contained in:
metalgearsloth
2024-03-30 03:03:01 +11:00
committed by GitHub
parent 4cd2fbd076
commit 28d05feea7

View File

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