Inline UID

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:53:09 +01:00
parent 2654775bf0
commit 5cd42c9ad6
803 changed files with 3613 additions and 3577 deletions

View File

@@ -29,13 +29,13 @@ namespace Content.Server.Atmos.EntitySystems
{
if (airtight.FixAirBlockedDirectionInitialize)
{
var rotateEvent = new RotateEvent(airtight.Owner, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).WorldRotation);
var rotateEvent = new RotateEvent(airtight.Owner, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).WorldRotation);
OnAirtightRotated(uid, airtight, ref rotateEvent);
}
// Adding this component will immediately anchor the entity, because the atmos system
// requires airtight entities to be anchored for performance.
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).Anchored = true;
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).Anchored = true;
UpdatePosition(airtight);
}
@@ -54,8 +54,8 @@ namespace Content.Server.Atmos.EntitySystems
private void OnAirtightPositionChanged(EntityUid uid, AirtightComponent airtight, ref AnchorStateChangedEvent args)
{
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).GridID;
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).Coordinates;
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).GridID;
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).Coordinates;
var grid = _mapManager.GetGrid(gridId);
var tilePos = grid.TileIndicesFor(coords);
@@ -84,11 +84,11 @@ namespace Content.Server.Atmos.EntitySystems
public void UpdatePosition(AirtightComponent airtight)
{
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).Anchored || !IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).GridID.IsValid())
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).Anchored || !IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).GridID.IsValid())
return;
var grid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).GridID);
airtight.LastPosition = (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).GridID, grid.TileIndicesFor(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner.Uid).Coordinates));
var grid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).GridID);
airtight.LastPosition = (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).GridID, grid.TileIndicesFor(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).Coordinates));
InvalidatePosition(airtight.LastPosition.Item1, airtight.LastPosition.Item2, airtight.FixVacuum && !airtight.AirBlocked);
}