Skip to content

Commit

Permalink
Update Submodule to 219.2.0 (#536)
Browse files Browse the repository at this point in the history
Uses the following Cherry-Picks:
space-wizards/space-station-14#26994
space-wizards/space-station-14#26518
space-wizards/space-station-14#26279
space-wizards/space-station-14#24946
space-wizards/space-station-14#27188

Requires:
#535
#534

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Co-authored-by: Jake Huxell <JakeHuxell@pm.me>
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Co-authored-by: 0x6273 <0x40@keemail.me>
Co-authored-by: DEATHB4DEFEAT <zachcaffee@outlook.com>
  • Loading branch information
7 people authored Jul 12, 2024
1 parent 50ec3cd commit 30fa120
Show file tree
Hide file tree
Showing 162 changed files with 1,351 additions and 1,297 deletions.
2 changes: 0 additions & 2 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.Alerts;

Expand All @@ -13,7 +12,6 @@ public sealed class ClientAlertsSystem : AlertsSystem
{
public AlertOrderPrototype? AlertOrder { get; set; }

[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ClothingComponent clothing, str
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var correctedSlot = slot;
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Doors/DoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Timing;

namespace Content.Client.Doors;

public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

public override void Initialize()
Expand Down
12 changes: 5 additions & 7 deletions Content.Client/IconSmoothing/IconSmoothSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace Content.Client.IconSmoothing
[UsedImplicitly]
public sealed partial class IconSmoothSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;

private readonly Queue<EntityUid> _dirtyEntities = new();
private readonly Queue<EntityUid> _anchorChangedEntities = new();

Expand Down Expand Up @@ -47,7 +45,7 @@ private void OnStartup(EntityUid uid, IconSmoothComponent component, ComponentSt
var xform = Transform(uid);
if (xform.Anchored)
{
component.LastPosition = _mapManager.TryGetGrid(xform.GridUid, out var grid)
component.LastPosition = TryComp<MapGridComponent>(xform.GridUid, out var grid)
? (xform.GridUid.Value, grid.TileIndicesFor(xform.Coordinates))
: (null, new Vector2i(0, 0));

Expand Down Expand Up @@ -134,7 +132,7 @@ public void DirtyNeighbours(EntityUid uid, IconSmoothComponent? comp = null, Tra

Vector2i pos;

if (transform.Anchored && _mapManager.TryGetGrid(transform.GridUid, out var grid))
if (transform.Anchored && TryComp<MapGridComponent>(transform.GridUid, out var grid))
{
pos = grid.CoordinatesToTile(transform.Coordinates);
}
Expand All @@ -144,7 +142,7 @@ public void DirtyNeighbours(EntityUid uid, IconSmoothComponent? comp = null, Tra
if (comp.LastPosition is not (EntityUid gridId, Vector2i oldPos))
return;

if (!_mapManager.TryGetGrid(gridId, out grid))
if (!TryComp(gridId, out grid))
return;

pos = oldPos;
Expand Down Expand Up @@ -206,7 +204,7 @@ private void CalculateNewSprite(EntityUid uid,
{
var directions = DirectionFlag.None;

if (_mapManager.TryGetGrid(xform.GridUid, out grid))
if (TryComp(xform.GridUid, out grid))
{
var pos = grid.TileIndicesFor(xform.Coordinates);

Expand Down Expand Up @@ -240,7 +238,7 @@ private void CalculateNewSprite(EntityUid uid,

if (xform.Anchored)
{
if (!_mapManager.TryGetGrid(xform.GridUid, out grid))
if (!TryComp(xform.GridUid, out grid))
{
Log.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridUid} was missing.");
return;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Items/Systems/ItemSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ItemComponent item, string defa
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var state = (item.HeldPrefix == null)
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Movement/Systems/JetpackSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;

Expand All @@ -12,7 +13,6 @@ namespace Content.Client.Movement.Systems;
public sealed class JetpackSystem : SharedJetpackSystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ClothingSystem _clothing = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

Expand Down Expand Up @@ -75,7 +75,7 @@ private void CreateParticles(EntityUid uid)
var coordinates = uidXform.Coordinates;
var gridUid = coordinates.GetGridUid(EntityManager);

if (_mapManager.TryGetGrid(gridUid, out var grid))
if (TryComp<MapGridComponent>(gridUid, out var grid))
{
coordinates = new EntityCoordinates(gridUid.Value, grid.WorldToLocal(coordinates.ToMapPos(EntityManager, _transform)));
}
Expand Down
1 change: 0 additions & 1 deletion Content.Client/NPC/PathfindingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ private void DrawScreen(OverlayDrawArgs args, DrawingHandleScreen screenHandle)

var invGridMatrix = gridXform.InvWorldMatrix;
DebugPathPoly? nearest = null;
var nearestDistance = float.MaxValue;

foreach (var poly in tile)
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/NodeContainer/NodeVisualizationOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void DrawScreen(in OverlayDrawArgs args)


var xform = _entityManager.GetComponent<TransformComponent>(_entityManager.GetEntity(node.Entity));
if (!_mapManager.TryGetGrid(xform.GridUid, out var grid))
if (!_entityManager.TryGetComponent<MapGridComponent>(xform.GridUid, out var grid))
return;
var gridTile = grid.TileIndicesFor(xform.Coordinates);

Expand Down Expand Up @@ -145,7 +145,7 @@ private void DrawWorld(in OverlayDrawArgs overlayDrawArgs)

foreach (var (gridId, gridDict) in _gridIndex)
{
var grid = _mapManager.GetGrid(gridId);
var grid = _entityManager.GetComponent<MapGridComponent>(gridId);
var (_, _, worldMatrix, invMatrix) = _entityManager.GetComponent<TransformComponent>(gridId).GetWorldPositionRotationMatrixWithInv();

var lCursorBox = invMatrix.TransformBox(cursorBox);
Expand Down
9 changes: 4 additions & 5 deletions Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;

namespace Content.Client.Radiation.Overlays;

public sealed class RadiationDebugOverlay : Overlay
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly RadiationSystem _radiation;

Expand Down Expand Up @@ -63,7 +62,7 @@ private void DrawScreenRays(OverlayDrawArgs args)
{
var gridUid = _entityManager.GetEntity(netGrid);

if (!_mapManager.TryGetGrid(gridUid, out var grid))
if (!_entityManager.TryGetComponent<MapGridComponent>(gridUid, out var grid))
continue;

foreach (var (tile, rads) in blockers)
Expand All @@ -88,7 +87,7 @@ private void DrawScreenResistance(OverlayDrawArgs args)
{
var gridUid = _entityManager.GetEntity(netGrid);

if (!_mapManager.TryGetGrid(gridUid, out var grid))
if (!_entityManager.TryGetComponent<MapGridComponent>(gridUid, out var grid))
continue;
if (query.TryGetComponent(gridUid, out var trs) && trs.MapID != args.MapId)
continue;
Expand Down Expand Up @@ -127,7 +126,7 @@ private void DrawWorld(in OverlayDrawArgs args)
{
var gridUid = _entityManager.GetEntity(netGrid);

if (!_mapManager.TryGetGrid(gridUid, out var grid))
if (!_entityManager.TryGetComponent<MapGridComponent>(gridUid, out var grid))
continue;
var (destTile, _) = blockers.Last();
var destWorld = grid.GridTileToWorldPos(destTile);
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ protected void DrawCircles(DrawingHandleScreen handle)
var cornerDistance = MathF.Sqrt(WorldRange * WorldRange + WorldRange * WorldRange);

var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));
var distOffset = -24f;

for (var radius = minDistance; radius <= maxDistance; radius *= EquatorialMultiplier)
{
Expand Down
7 changes: 3 additions & 4 deletions Content.IntegrationTests/Pair/TestMapData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace Content.IntegrationTests.Pair;
public sealed class TestMapData
{
public EntityUid MapUid { get; set; }
public EntityUid GridUid { get; set; }
public MapId MapId { get; set; }
public MapGridComponent MapGrid { get; set; } = default!;
public Entity<MapGridComponent> Grid;
public MapId MapId;
public EntityCoordinates GridCoords { get; set; }
public MapCoordinates MapCoords { get; set; }
public TileRef Tile { get; set; }
Expand All @@ -21,4 +20,4 @@ public sealed class TestMapData
public EntityUid CMapUid { get; set; }
public EntityUid CGridUid { get; set; }
public EntityCoordinates CGridCoords { get; set; }
}
}
26 changes: 14 additions & 12 deletions Content.IntegrationTests/Pair/TestPair.Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#nullable enable
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
Expand All @@ -14,36 +15,37 @@ public sealed partial class TestPair
/// <summary>
/// Creates a map, a grid, and a tile, and gives back references to them.
/// </summary>
public async Task<TestMapData> CreateTestMap()
[MemberNotNull(nameof(TestMap))]
public async Task<TestMapData> CreateTestMap(bool initialized = true, string tile = "Plating")
{
var mapData = new TestMapData();
TestMap = mapData;
await Server.WaitIdleAsync();
var tileDefinitionManager = Server.ResolveDependency<ITileDefinitionManager>();

var mapData = new TestMapData();
TestMap = mapData;
await Server.WaitPost(() =>
{
mapData.MapId = Server.MapMan.CreateMap();
mapData.MapUid = Server.MapMan.GetMapEntityId(mapData.MapId);
var mapGrid = Server.MapMan.CreateGridEntity(mapData.MapId);
mapData.MapGrid = mapGrid;
mapData.GridUid = mapGrid.Owner; // Fixing this requires an engine PR.
mapData.GridCoords = new EntityCoordinates(mapData.GridUid, 0, 0);
var plating = tileDefinitionManager["Plating"];
mapData.MapUid = Server.System<SharedMapSystem>().CreateMap(out mapData.MapId, runMapInit: initialized);
mapData.Grid = Server.MapMan.CreateGridEntity(mapData.MapId);
mapData.GridCoords = new EntityCoordinates(mapData.Grid, 0, 0);
var plating = tileDefinitionManager[tile];
var platingTile = new Tile(plating.TileId);
mapData.MapGrid.SetTile(mapData.GridCoords, platingTile);
mapData.Grid.Comp.SetTile(mapData.GridCoords, platingTile);
mapData.MapCoords = new MapCoordinates(0, 0, mapData.MapId);
mapData.Tile = mapData.MapGrid.GetAllTiles().First();
mapData.Tile = mapData.Grid.Comp.GetAllTiles().First();
});

TestMap = mapData;
if (!Settings.Connected)
return mapData;

await RunTicksSync(10);
mapData.CMapUid = ToClientUid(mapData.MapUid);
mapData.CGridUid = ToClientUid(mapData.GridUid);
mapData.CGridUid = ToClientUid(mapData.Grid);
mapData.CGridCoords = new EntityCoordinates(mapData.CGridUid, 0, 0);

TestMap = mapData;
return mapData;
}

Expand Down
5 changes: 0 additions & 5 deletions Content.IntegrationTests/PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,6 @@ await testOut.WriteLineAsync(
Pairs[fallback!] = true;
}

if (fallback == null && _pairId > 8)
{
var x = 2;
}

return fallback;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public async Task AddAndGetSingleLog()

var guid = Guid.NewGuid();

var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
await pair.CreateTestMap();
var coordinates = pair.TestMap.GridCoords;
await server.WaitPost(() =>
{
var entity = sEntities.SpawnEntity(null, coordinates);
Expand Down
39 changes: 18 additions & 21 deletions Content.IntegrationTests/Tests/Body/LungTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Maths;
using System.Linq;
using System.Numerics;

Expand Down Expand Up @@ -61,12 +60,11 @@ public async Task AirConsistencyTest()
var mapManager = server.ResolveDependency<IMapManager>();
var entityManager = server.ResolveDependency<IEntityManager>();
var mapLoader = entityManager.System<MapLoaderSystem>();
RespiratorSystem respSys = default;
MetabolizerSystem metaSys = default;

MapId mapId;
EntityUid? grid = null;
BodyComponent body = default;
RespiratorComponent resp = default;
EntityUid human = default;
GridAtmosphereComponent relevantAtmos = default;
var startingMoles = 0.0f;
Expand Down Expand Up @@ -99,17 +97,15 @@ float GetMapMoles()

await server.WaitAssertion(() =>
{
var coords = new Vector2(0.5f, -1f);
var coordinates = new EntityCoordinates(grid.Value, coords);
var center = new Vector2(0.5f, 0.5f);
var coordinates = new EntityCoordinates(grid.Value, center);
human = entityManager.SpawnEntity("HumanLungDummy", coordinates);
respSys = entityManager.System<RespiratorSystem>();
metaSys = entityManager.System<MetabolizerSystem>();
relevantAtmos = entityManager.GetComponent<GridAtmosphereComponent>(grid.Value);
startingMoles = GetMapMoles();
startingMoles = 100f; // Hardcoded because GetMapMoles returns 900 here for some reason.
#pragma warning disable NUnit2045
Assert.That(entityManager.TryGetComponent(human, out body), Is.True);
Assert.That(entityManager.HasComponent<RespiratorComponent>(human), Is.True);
Assert.That(entityManager.TryGetComponent(human, out resp), Is.True);
#pragma warning restore NUnit2045
});

Expand All @@ -118,18 +114,19 @@ await server.WaitAssertion(() =>
var inhaleCycles = 100;
for (var i = 0; i < inhaleCycles; i++)
{
await server.WaitAssertion(() =>
{
// inhale
respSys.Update(2.0f);
Assert.That(GetMapMoles(), Is.LessThan(startingMoles));
// metabolize + exhale
metaSys.Update(1.0f);
metaSys.Update(1.0f);
respSys.Update(2.0f);
Assert.That(GetMapMoles(), Is.EqualTo(startingMoles).Within(0.0002));
});
// Breathe in
await PoolManager.WaitUntil(server, () => resp.Status == RespiratorStatus.Exhaling);
Assert.That(
GetMapMoles(), Is.LessThan(startingMoles),
"Did not inhale in any gas"
);

// Breathe out
await PoolManager.WaitUntil(server, () => resp.Status == RespiratorStatus.Inhaling);
Assert.That(
GetMapMoles(), Is.EqualTo(startingMoles).Within(0.0002),
"Did not exhale as much gas as was inhaled"
);
}

await pair.CleanReturnAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public async Task WiredNetworkDeviceSendAndReceive()
DeviceNetworkComponent networkComponent1 = null;
DeviceNetworkComponent networkComponent2 = null;
WiredNetworkComponent wiredNetworkComponent = null;
var grid = testMap.MapGrid;
var grid = testMap.Grid.Comp;

var testValue = "test";
var payload = new NetworkPayload
Expand Down
Loading

0 comments on commit 30fa120

Please sign in to comment.