Fix GravityGridTest (#23348)
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user