Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -27,16 +27,18 @@ public abstract class MovementTest : InteractionTest
public override async Task Setup()
{
await base.Setup();
var pCoords = SEntMan.GetCoordinates(PlayerCoords);
for (var i = -Tiles; i <= Tiles; i++)
{
await SetTile(Plating, PlayerCoords.Offset(new Vector2(i, 0)), MapData.MapGrid);
await SetTile(Plating, SEntMan.GetNetCoordinates(pCoords.Offset(new Vector2(i, 0))), MapData.MapGrid);
}
AssertGridCount(1);
if (AddWalls)
{
await SpawnEntity("WallSolid", PlayerCoords.Offset(new Vector2(-Tiles, 0)));
await SpawnEntity("WallSolid", PlayerCoords.Offset(new Vector2(Tiles, 0)));
await SpawnEntity("WallSolid", pCoords.Offset(new Vector2(-Tiles, 0)));
await SpawnEntity("WallSolid", pCoords.Offset(new Vector2(Tiles, 0)));
}
await AddGravity();
@@ -46,7 +48,7 @@ public abstract class MovementTest : InteractionTest
/// <summary>
/// Get the relative horizontal between two entities. Defaults to using the target & player entity.
/// </summary>
protected float Delta(EntityUid? target = null, EntityUid? other = null)
protected float Delta(NetEntity? target = null, NetEntity? other = null)
{
target ??= Target;
if (target == null)
@@ -55,7 +57,7 @@ public abstract class MovementTest : InteractionTest
return 0;
}
var delta = Transform.GetWorldPosition(target.Value) - Transform.GetWorldPosition(other ?? Player);
var delta = Transform.GetWorldPosition(SEntMan.GetEntity(target.Value)) - Transform.GetWorldPosition(SEntMan.GetEntity(other ?? Player));
return delta.X;
}
}