Fix warnings in Joints_Test (#5885)

This commit is contained in:
Tayrtahn
2025-04-24 04:09:27 -04:00
committed by GitHub
parent 2f85408f8f
commit 3ed408de5d

View File

@@ -71,7 +71,9 @@ public sealed class Joints_Test
var physicsSystem = server.Resolve<IEntitySystemManager>().GetEntitySystem<SharedPhysicsSystem>();
var mapSystem = entManager.System<SharedMapSystem>();
var mapId = server.CreateMap().MapId;
var map = server.CreateMap();
var mapId = map.MapId;
var physicsMapComp = entManager.GetComponent<PhysicsMapComponent>(map.Uid);
var ent1 = entManager.SpawnEntity(null, new MapCoordinates(Vector2.Zero, mapId));
var ent2 = entManager.SpawnEntity(null, new MapCoordinates(Vector2.Zero, mapId));
@@ -93,7 +95,7 @@ public sealed class Joints_Test
Assert.That(entManager.HasComponent<JointComponent>(ent1), Is.EqualTo(true));
// We should have a contact in both situations.
broadphaseSystem.FindNewContacts(mapId);
broadphaseSystem.FindNewContacts(physicsMapComp, mapId);
Assert.That(body1.Contacts, Has.Count.EqualTo(1));
// Alright now try the other way
@@ -103,7 +105,7 @@ public sealed class Joints_Test
jointSystem.Update(0.016f);
Assert.That(entManager.HasComponent<JointComponent>(ent1));
broadphaseSystem.FindNewContacts(mapId);
broadphaseSystem.FindNewContacts(physicsMapComp, mapId);
Assert.That(body1.Contacts, Has.Count.EqualTo(1));
mapSystem.DeleteMap(mapId);