Replace IEntityManager resolves in systems for cached EntityManager
This commit is contained in:
@@ -55,7 +55,7 @@ namespace Content.Server.AI.EntitySystems
|
|||||||
public Faction GetHostileFactions(Faction faction) => _hostileFactions.TryGetValue(faction, out var hostiles) ? hostiles : Faction.None;
|
public Faction GetHostileFactions(Faction faction) => _hostileFactions.TryGetValue(faction, out var hostiles) ? hostiles : Faction.None;
|
||||||
|
|
||||||
public Faction GetFactions(EntityUid entity) =>
|
public Faction GetFactions(EntityUid entity) =>
|
||||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out AiFactionTagComponent? factionTags)
|
EntityManager.TryGetComponent(entity, out AiFactionTagComponent? factionTags)
|
||||||
? factionTags.Factions
|
? factionTags.Factions
|
||||||
: Faction.None;
|
: Faction.None;
|
||||||
|
|
||||||
@@ -72,9 +72,9 @@ namespace Content.Server.AI.EntitySystems
|
|||||||
{
|
{
|
||||||
if ((component.Factions & hostile) == 0)
|
if ((component.Factions & hostile) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).MapID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).MapID)
|
if (EntityManager.GetComponent<TransformComponent>(component.Owner).MapID != EntityManager.GetComponent<TransformComponent>(entity).MapID)
|
||||||
continue;
|
continue;
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).MapPosition.InRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).MapPosition, range))
|
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).MapPosition.InRange(EntityManager.GetComponent<TransformComponent>(entity).MapPosition, range))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
yield return component.Owner;
|
yield return component.Owner;
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ namespace Content.Server.AI.Pathfinding.Accessible
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entityTile = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID).GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates);
|
var entityTile = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID).GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||||
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
||||||
var entityRegion = GetRegion(entityNode);
|
var entityRegion = GetRegion(entityNode);
|
||||||
var targetRegion = GetRegion(targetNode);
|
var targetRegion = GetRegion(targetNode);
|
||||||
@@ -424,12 +424,12 @@ namespace Content.Server.AI.Pathfinding.Accessible
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PathfindingRegion? GetRegion(EntityUid entity)
|
public PathfindingRegion? GetRegion(EntityUid entity)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID.IsValid())
|
if (!EntityManager.GetComponent<TransformComponent>(entity).GridID.IsValid())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entityTile = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID).GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates);
|
var entityTile = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID).GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||||
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
var entityNode = _pathfindingSystem.GetNode(entityTile);
|
||||||
return GetRegion(entityNode);
|
return GetRegion(entityNode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ namespace Content.Server.AI.Pathfinding
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PathfindingNode GetNode(EntityUid entity)
|
public PathfindingNode GetNode(EntityUid entity)
|
||||||
{
|
{
|
||||||
var tile = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID).GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates);
|
var tile = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID).GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||||
return GetNode(tile);
|
return GetNode(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,16 +264,16 @@ namespace Content.Server.AI.Pathfinding
|
|||||||
/// <param name="entity"></param>
|
/// <param name="entity"></param>
|
||||||
private void HandleEntityAdd(EntityUid entity)
|
private void HandleEntityAdd(EntityUid entity)
|
||||||
{
|
{
|
||||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(entity) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
if ((!EntityManager.EntityExists(entity) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||||
_lastKnownPositions.ContainsKey(entity) ||
|
_lastKnownPositions.ContainsKey(entity) ||
|
||||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics) ||
|
!EntityManager.TryGetComponent(entity, out IPhysBody? physics) ||
|
||||||
!PathfindingNode.IsRelevant(entity, physics))
|
!PathfindingNode.IsRelevant(entity, physics))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var grid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID);
|
var grid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID);
|
||||||
var tileRef = grid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates);
|
var tileRef = grid.GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||||
|
|
||||||
var chunk = GetChunk(tileRef);
|
var chunk = GetChunk(tileRef);
|
||||||
var node = chunk.GetNode(tileRef);
|
var node = chunk.GetNode(tileRef);
|
||||||
@@ -304,8 +304,8 @@ namespace Content.Server.AI.Pathfinding
|
|||||||
private void HandleEntityMove(MoveEvent moveEvent)
|
private void HandleEntityMove(MoveEvent moveEvent)
|
||||||
{
|
{
|
||||||
// If we've moved to space or the likes then remove us.
|
// If we've moved to space or the likes then remove us.
|
||||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(moveEvent.Sender) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(moveEvent.Sender).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
if ((!EntityManager.EntityExists(moveEvent.Sender) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(moveEvent.Sender).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(moveEvent.Sender, out IPhysBody? physics) ||
|
!EntityManager.TryGetComponent(moveEvent.Sender, out IPhysBody? physics) ||
|
||||||
!PathfindingNode.IsRelevant(moveEvent.Sender, physics) ||
|
!PathfindingNode.IsRelevant(moveEvent.Sender, physics) ||
|
||||||
moveEvent.NewPosition.GetGridId(EntityManager) == GridId.Invalid)
|
moveEvent.NewPosition.GetGridId(EntityManager) == GridId.Invalid)
|
||||||
{
|
{
|
||||||
@@ -314,9 +314,9 @@ namespace Content.Server.AI.Pathfinding
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Memory leak protection until grid parenting confirmed fix / you REALLY need the performance
|
// Memory leak protection until grid parenting confirmed fix / you REALLY need the performance
|
||||||
var gridBounds = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(moveEvent.Sender).GridID).WorldBounds;
|
var gridBounds = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(moveEvent.Sender).GridID).WorldBounds;
|
||||||
|
|
||||||
if (!gridBounds.Contains(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(moveEvent.Sender).WorldPosition))
|
if (!gridBounds.Contains(EntityManager.GetComponent<TransformComponent>(moveEvent.Sender).WorldPosition))
|
||||||
{
|
{
|
||||||
HandleEntityRemove(moveEvent.Sender);
|
HandleEntityRemove(moveEvent.Sender);
|
||||||
return;
|
return;
|
||||||
@@ -370,7 +370,7 @@ namespace Content.Server.AI.Pathfinding
|
|||||||
|
|
||||||
public bool CanTraverse(EntityUid entity, PathfindingNode node)
|
public bool CanTraverse(EntityUid entity, PathfindingNode node)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics) &&
|
if (EntityManager.TryGetComponent(entity, out IPhysBody? physics) &&
|
||||||
(physics.CollisionMask & node.BlockedCollisionMask) != 0)
|
(physics.CollisionMask & node.BlockedCollisionMask) != 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Content.Server.Access.Systems
|
|||||||
|
|
||||||
private void OnInit(EntityUid uid, IdCardComponent id, ComponentInit args)
|
private void OnInit(EntityUid uid, IdCardComponent id, ComponentInit args)
|
||||||
{
|
{
|
||||||
id.OriginalOwnerName ??= IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner).EntityName;
|
id.OriginalOwnerName ??= EntityManager.GetComponent<MetaDataComponent>(id.Owner).EntityName;
|
||||||
UpdateEntityName(uid, id);
|
UpdateEntityName(uid, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ namespace Content.Server.Access.Systems
|
|||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(id.FullName) && string.IsNullOrWhiteSpace(id.JobTitle))
|
if (string.IsNullOrWhiteSpace(id.FullName) && string.IsNullOrWhiteSpace(id.JobTitle))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner).EntityName = id.OriginalOwnerName;
|
EntityManager.GetComponent<MetaDataComponent>(id.Owner).EntityName = id.OriginalOwnerName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ namespace Content.Server.Access.Systems
|
|||||||
: Loc.GetString("access-id-card-component-owner-full-name-job-title-text",
|
: Loc.GetString("access-id-card-component-owner-full-name-job-title-text",
|
||||||
("fullName", id.FullName),
|
("fullName", id.FullName),
|
||||||
("jobSuffix", jobSuffix));
|
("jobSuffix", jobSuffix));
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner).EntityName = val;
|
EntityManager.GetComponent<MetaDataComponent>(id.Owner).EntityName = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
foreach (var entity in _gridtileLookupSystem.GetEntitiesIntersecting(tile.GridIndex, tile.GridIndices))
|
foreach (var entity in _gridtileLookupSystem.GetEntitiesIntersecting(tile.GridIndex, tile.GridIndices))
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics)
|
if (!EntityManager.TryGetComponent(entity, out IPhysBody? physics)
|
||||||
|| !entity.IsMovedByPressure(out var pressure)
|
|| !entity.IsMovedByPressure(out var pressure)
|
||||||
|| entity.IsInContainer())
|
|| entity.IsInContainer())
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
{
|
{
|
||||||
foreach (var exposed in EntityManager.EntityQuery<AtmosExposedComponent>())
|
foreach (var exposed in EntityManager.EntityQuery<AtmosExposedComponent>())
|
||||||
{
|
{
|
||||||
var tile = GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(exposed.Owner).Coordinates);
|
var tile = GetTileMixture(EntityManager.GetComponent<TransformComponent>(exposed.Owner).Coordinates);
|
||||||
if (tile == null) continue;
|
if (tile == null) continue;
|
||||||
var updateEvent = new AtmosExposedUpdateEvent(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(exposed.Owner).Coordinates, tile);
|
var updateEvent = new AtmosExposedUpdateEvent(EntityManager.GetComponent<TransformComponent>(exposed.Owner).Coordinates, tile);
|
||||||
RaiseLocalEvent(exposed.Owner, ref updateEvent);
|
RaiseLocalEvent(exposed.Owner, ref updateEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
var uid = barotrauma.Owner;
|
var uid = barotrauma.Owner;
|
||||||
|
|
||||||
var status = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerAlertsComponent>(barotrauma.Owner);
|
var status = EntityManager.GetComponentOrNull<ServerAlertsComponent>(barotrauma.Owner);
|
||||||
|
|
||||||
var pressure = 1f;
|
var pressure = 1f;
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
flammable.FireStacks = MathF.Min(0, flammable.FireStacks + 1);
|
flammable.FireStacks = MathF.Min(0, flammable.FireStacks + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(flammable.Owner, out ServerAlertsComponent? status);
|
EntityManager.TryGetComponent(flammable.Owner, out ServerAlertsComponent? status);
|
||||||
|
|
||||||
if (!flammable.OnFire)
|
if (!flammable.OnFire)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
|
|
||||||
private void AddOpenUIVerb(EntityUid uid, GasTankComponent component, GetActivationVerbsEvent args)
|
private void AddOpenUIVerb(EntityUid uid, GasTankComponent component, GetActivationVerbsEvent args)
|
||||||
{
|
{
|
||||||
if (!args.CanAccess || !IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User, out var actor))
|
if (!args.CanAccess || !EntityManager.TryGetComponent<ActorComponent?>(args.User, out var actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
|
|||||||
@@ -196,17 +196,17 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
// This is the max in any direction that we can get a chunk (e.g. max 2 chunks away of data).
|
// This is the max in any direction that we can get a chunk (e.g. max 2 chunks away of data).
|
||||||
var (maxXDiff, maxYDiff) = ((int) (_updateRange / ChunkSize) + 1, (int) (_updateRange / ChunkSize) + 1);
|
var (maxXDiff, maxYDiff) = ((int) (_updateRange / ChunkSize) + 1, (int) (_updateRange / ChunkSize) + 1);
|
||||||
|
|
||||||
var worldBounds = Box2.CenteredAround(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).WorldPosition,
|
var worldBounds = Box2.CenteredAround(EntityManager.GetComponent<TransformComponent>(entity).WorldPosition,
|
||||||
new Vector2(_updateRange, _updateRange));
|
new Vector2(_updateRange, _updateRange));
|
||||||
|
|
||||||
foreach (var grid in _mapManager.FindGridsIntersecting(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).MapID, worldBounds))
|
foreach (var grid in _mapManager.FindGridsIntersecting(EntityManager.GetComponent<TransformComponent>(entity).MapID, worldBounds))
|
||||||
{
|
{
|
||||||
if (!_overlay.TryGetValue(grid.Index, out var chunks))
|
if (!_overlay.TryGetValue(grid.Index, out var chunks))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entityTile = grid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates).GridIndices;
|
var entityTile = grid.GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates).GridIndices;
|
||||||
|
|
||||||
for (var x = -maxXDiff; x <= maxXDiff; x++)
|
for (var x = -maxXDiff; x <= maxXDiff; x++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnGasDualPortVentPumpUpdated(EntityUid uid, GasDualPortVentPumpComponent vent, AtmosDeviceUpdateEvent args)
|
private void OnGasDualPortVentPumpUpdated(EntityUid uid, GasDualPortVentPumpComponent vent, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var appearance = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<AppearanceComponent>(vent.Owner);
|
var appearance = EntityManager.GetComponentOrNull<AppearanceComponent>(vent.Owner);
|
||||||
|
|
||||||
if (vent.Welded)
|
if (vent.Welded)
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(vent.Owner).Coordinates, true);
|
var environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(vent.Owner).Coordinates, true);
|
||||||
|
|
||||||
// We're in an air-blocked tile... Do nothing.
|
// We're in an air-blocked tile... Do nothing.
|
||||||
if (environment == null)
|
if (environment == null)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnExamined(EntityUid uid, GasPressurePumpComponent pump, ExaminedEvent args)
|
private void OnExamined(EntityUid uid, GasPressurePumpComponent pump, ExaminedEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
if (!EntityManager.GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Loc.TryGetString("gas-pressure-pump-system-examined", out var str,
|
if (Loc.TryGetString("gas-pressure-pump-system-examined", out var str,
|
||||||
@@ -50,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args)
|
private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var appearance = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<AppearanceComponent>(pump.Owner);
|
var appearance = EntityManager.GetComponentOrNull<AppearanceComponent>(pump.Owner);
|
||||||
|
|
||||||
if (!pump.Enabled
|
if (!pump.Enabled
|
||||||
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
||||||
@@ -92,10 +92,10 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnPumpInteractHand(EntityUid uid, GasPressurePumpComponent component, InteractHandEvent args)
|
private void OnPumpInteractHand(EntityUid uid, GasPressurePumpComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
{
|
{
|
||||||
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
|
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
|
||||||
DirtyUI(uid, component);
|
DirtyUI(uid, component);
|
||||||
@@ -127,7 +127,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key,
|
_userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key,
|
||||||
new GasPressurePumpBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TargetPressure, pump.Enabled));
|
new GasPressurePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TargetPressure, pump.Enabled));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnExamined(EntityUid uid, GasValveComponent valve, ExaminedEvent args)
|
private void OnExamined(EntityUid uid, GasValveComponent valve, ExaminedEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(valve.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
if (!EntityManager.GetComponent<TransformComponent>(valve.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Loc.TryGetString("gas-valve-system-examined", out var str,
|
if (Loc.TryGetString("gas-valve-system-examined", out var str,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnExamined(EntityUid uid, GasVolumePumpComponent pump, ExaminedEvent args)
|
private void OnExamined(EntityUid uid, GasVolumePumpComponent pump, ExaminedEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
if (!EntityManager.GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Loc.TryGetString("gas-volume-pump-system-examined", out var str,
|
if (Loc.TryGetString("gas-volume-pump-system-examined", out var str,
|
||||||
@@ -83,7 +83,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
// Some of the gas from the mixture leaks when overclocked.
|
// Some of the gas from the mixture leaks when overclocked.
|
||||||
if (pump.Overclocked)
|
if (pump.Overclocked)
|
||||||
{
|
{
|
||||||
var tile = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pump.Owner).Coordinates, true);
|
var tile = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(pump.Owner).Coordinates, true);
|
||||||
|
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
{
|
{
|
||||||
@@ -97,10 +97,10 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
|
|
||||||
private void OnPumpInteractHand(EntityUid uid, GasVolumePumpComponent component, InteractHandEvent args)
|
private void OnPumpInteractHand(EntityUid uid, GasVolumePumpComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
{
|
{
|
||||||
_userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
|
_userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
|
||||||
DirtyUI(uid, component);
|
DirtyUI(uid, component);
|
||||||
@@ -132,7 +132,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
|
_userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
|
||||||
new GasVolumePumpBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TransferRate, pump.Enabled));
|
new GasVolumePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TransferRate, pump.Enabled));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
|||||||
|
|
||||||
private bool CanJoinAtmosphere(AtmosDeviceComponent component)
|
private bool CanJoinAtmosphere(AtmosDeviceComponent component)
|
||||||
{
|
{
|
||||||
return !component.RequireAnchored || IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored;
|
return !component.RequireAnchored || EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void JoinAtmosphere(AtmosDeviceComponent component)
|
public void JoinAtmosphere(AtmosDeviceComponent component)
|
||||||
@@ -104,7 +104,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
|||||||
if (!component.RequireAnchored)
|
if (!component.RequireAnchored)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if(EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
JoinAtmosphere(component);
|
JoinAtmosphere(component);
|
||||||
else
|
else
|
||||||
LeaveAtmosphere(component);
|
LeaveAtmosphere(component);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
|||||||
if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
|
if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates) is not {} environment)
|
if (_atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates) is not {} environment)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var node in nodes.Nodes.Values)
|
foreach (var node in nodes.Nodes.Values)
|
||||||
@@ -52,7 +52,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
|
|||||||
if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
|
if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates, true) is not {} environment)
|
if (_atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates, true) is not {} environment)
|
||||||
environment = GasMixture.SpaceGas;
|
environment = GasMixture.SpaceGas;
|
||||||
|
|
||||||
var lost = 0f;
|
var lost = 0f;
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ namespace Content.Server.Atmos.Piping.Other.EntitySystems
|
|||||||
|
|
||||||
private bool CheckMinerOperation(GasMinerComponent miner, [NotNullWhen(true)] out GasMixture? environment)
|
private bool CheckMinerOperation(GasMinerComponent miner, [NotNullWhen(true)] out GasMixture? environment)
|
||||||
{
|
{
|
||||||
environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(miner.Owner).Coordinates, true);
|
environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(miner.Owner).Coordinates, true);
|
||||||
|
|
||||||
// Space.
|
// Space.
|
||||||
if (_atmosphereSystem.IsTileSpace(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(miner.Owner).Coordinates))
|
if (_atmosphereSystem.IsTileSpace(EntityManager.GetComponent<TransformComponent>(miner.Owner).Coordinates))
|
||||||
{
|
{
|
||||||
miner.Broken = true;
|
miner.Broken = true;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
|
|
||||||
private void OnFilterUpdated(EntityUid uid, GasFilterComponent filter, AtmosDeviceUpdateEvent args)
|
private void OnFilterUpdated(EntityUid uid, GasFilterComponent filter, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var appearance = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<AppearanceComponent>(filter.Owner);
|
var appearance = EntityManager.GetComponentOrNull<AppearanceComponent>(filter.Owner);
|
||||||
|
|
||||||
if (!filter.Enabled
|
if (!filter.Enabled
|
||||||
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
||||||
@@ -81,10 +81,10 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
|
|
||||||
private void OnFilterInteractHand(EntityUid uid, GasFilterComponent component, InteractHandEvent args)
|
private void OnFilterInteractHand(EntityUid uid, GasFilterComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
{
|
{
|
||||||
_userInterfaceSystem.TryOpen(uid, GasFilterUiKey.Key, actor.PlayerSession);
|
_userInterfaceSystem.TryOpen(uid, GasFilterUiKey.Key, actor.PlayerSession);
|
||||||
DirtyUI(uid, component);
|
DirtyUI(uid, component);
|
||||||
@@ -104,7 +104,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_userInterfaceSystem.TrySetUiState(uid, GasFilterUiKey.Key,
|
_userInterfaceSystem.TrySetUiState(uid, GasFilterUiKey.Key,
|
||||||
new GasFilterBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(filter.Owner).EntityName, filter.TransferRate, filter.Enabled, filter.FilteredGas));
|
new GasFilterBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(filter.Owner).EntityName, filter.TransferRate, filter.Enabled, filter.FilteredGas));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
|
|
||||||
private void OnMixerInteractHand(EntityUid uid, GasMixerComponent component, InteractHandEvent args)
|
private void OnMixerInteractHand(EntityUid uid, GasMixerComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
{
|
{
|
||||||
_userInterfaceSystem.TryOpen(uid, GasMixerUiKey.Key, actor.PlayerSession);
|
_userInterfaceSystem.TryOpen(uid, GasMixerUiKey.Key, actor.PlayerSession);
|
||||||
DirtyUI(uid, component);
|
DirtyUI(uid, component);
|
||||||
@@ -128,7 +128,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_userInterfaceSystem.TrySetUiState(uid, GasMixerUiKey.Key,
|
_userInterfaceSystem.TrySetUiState(uid, GasMixerUiKey.Key,
|
||||||
new GasMixerBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mixer.Owner).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
|
new GasMixerBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(mixer.Owner).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
if (!nodeContainer.TryGetNode(injector.InletName, out PipeNode? inlet))
|
if (!nodeContainer.TryGetNode(injector.InletName, out PipeNode? inlet))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(injector.Owner).Coordinates, true);
|
var environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(injector.Owner).Coordinates, true);
|
||||||
|
|
||||||
if (environment == null)
|
if (environment == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
|
|
||||||
private void OnPassiveVentUpdated(EntityUid uid, GasPassiveVentComponent vent, AtmosDeviceUpdateEvent args)
|
private void OnPassiveVentUpdated(EntityUid uid, GasPassiveVentComponent vent, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(vent.Owner).Coordinates, true);
|
var environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(vent.Owner).Coordinates, true);
|
||||||
|
|
||||||
if (environment == null)
|
if (environment == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
|
|
||||||
private void OnThermoMachineUpdated(EntityUid uid, GasThermoMachineComponent thermoMachine, AtmosDeviceUpdateEvent args)
|
private void OnThermoMachineUpdated(EntityUid uid, GasThermoMachineComponent thermoMachine, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var appearance = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<AppearanceComponent>(thermoMachine.Owner);
|
var appearance = EntityManager.GetComponentOrNull<AppearanceComponent>(thermoMachine.Owner);
|
||||||
|
|
||||||
if (!thermoMachine.Enabled
|
if (!thermoMachine.Enabled
|
||||||
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
|| !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
|
|
||||||
private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args)
|
private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args)
|
||||||
{
|
{
|
||||||
var appearance = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<AppearanceComponent>(scrubber.Owner);
|
var appearance = EntityManager.GetComponentOrNull<AppearanceComponent>(scrubber.Owner);
|
||||||
|
|
||||||
if (scrubber.Welded)
|
if (scrubber.Welded)
|
||||||
{
|
{
|
||||||
@@ -44,14 +44,14 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(scrubber.Owner).Coordinates, true);
|
var environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(scrubber.Owner).Coordinates, true);
|
||||||
|
|
||||||
Scrub(_atmosphereSystem, scrubber, appearance, environment, outlet);
|
Scrub(_atmosphereSystem, scrubber, appearance, environment, outlet);
|
||||||
|
|
||||||
if (!scrubber.WideNet) return;
|
if (!scrubber.WideNet) return;
|
||||||
|
|
||||||
// Scrub adjacent tiles too.
|
// Scrub adjacent tiles too.
|
||||||
foreach (var adjacent in _atmosphereSystem.GetAdjacentTileMixtures(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(scrubber.Owner).Coordinates, false, true))
|
foreach (var adjacent in _atmosphereSystem.GetAdjacentTileMixtures(EntityManager.GetComponent<TransformComponent>(scrubber.Owner).Coordinates, false, true))
|
||||||
{
|
{
|
||||||
Scrub(_atmosphereSystem, scrubber, null, adjacent, outlet);
|
Scrub(_atmosphereSystem, scrubber, null, adjacent, outlet);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ namespace Content.Server.BarSign.Systems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
if (EntityManager.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) || !receiver.Powered)
|
if (!EntityManager.TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) || !receiver.Powered)
|
||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "empty");
|
sprite.LayerSetState(0, "empty");
|
||||||
sprite.LayerSetShader(0, "shaded");
|
sprite.LayerSetShader(0, "shaded");
|
||||||
@@ -83,15 +83,15 @@ namespace Content.Server.BarSign.Systems
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(prototype.Name))
|
if (!string.IsNullOrEmpty(prototype.Name))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityName = prototype.Name;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = prototype.Name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string val = Loc.GetString("barsign-component-name");
|
string val = Loc.GetString("barsign-component-name");
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityDescription = prototype.Description;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityDescription = prototype.Description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace Content.Server.Buckle.Systems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var strapPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(strap.Owner).Coordinates.Offset(buckle.BuckleOffset);
|
var strapPosition = EntityManager.GetComponent<TransformComponent>(strap.Owner).Coordinates.Offset(buckle.BuckleOffset);
|
||||||
|
|
||||||
if (ev.NewPosition.InRange(EntityManager, strapPosition, 0.2f))
|
if (ev.NewPosition.InRange(EntityManager, strapPosition, 0.2f))
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ namespace Content.Server.Buckle.Systems
|
|||||||
// This fixes buckle offsets and draw depths.
|
// This fixes buckle offsets and draw depths.
|
||||||
foreach (var buckledEntity in strap.BuckledEntities)
|
foreach (var buckledEntity in strap.BuckledEntities)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity, out BuckleComponent? buckled))
|
if (!EntityManager.TryGetComponent(buckledEntity, out BuckleComponent? buckled))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ namespace Content.Server.Buckle.Systems
|
|||||||
{
|
{
|
||||||
foreach (var buckledEntity in strap.BuckledEntities)
|
foreach (var buckledEntity in strap.BuckledEntities)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity, out BuckleComponent? buckled))
|
if (!EntityManager.TryGetComponent(buckledEntity, out BuckleComponent? buckled))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
owner.PopupMessageEveryone(Loc.GetString("rehydratable-component-expands-message", ("owner", owner)));
|
owner.PopupMessageEveryone(Loc.GetString("rehydratable-component-expands-message", ("owner", owner)));
|
||||||
if (!string.IsNullOrEmpty(component.TargetPrototype))
|
if (!string.IsNullOrEmpty(component.TargetPrototype))
|
||||||
{
|
{
|
||||||
var ent = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.TargetPrototype,
|
var ent = EntityManager.SpawnEntity(component.TargetPrototype,
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).Coordinates);
|
EntityManager.GetComponent<TransformComponent>(owner).Coordinates);
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent).AttachToGridOrMap();
|
EntityManager.GetComponent<TransformComponent>(ent).AttachToGridOrMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) owner);
|
EntityManager.QueueDeleteEntity((EntityUid) owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
{
|
{
|
||||||
var reagentQuantity = FixedPoint2.New(0);
|
var reagentQuantity = FixedPoint2.New(0);
|
||||||
if (EntityManager.EntityExists(owner)
|
if (EntityManager.EntityExists(owner)
|
||||||
&& IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out SolutionContainerManagerComponent? managerComponent))
|
&& EntityManager.TryGetComponent(owner, out SolutionContainerManagerComponent? managerComponent))
|
||||||
{
|
{
|
||||||
foreach (var solution in managerComponent.Solutions.Values)
|
foreach (var solution in managerComponent.Solutions.Values)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
|
|
||||||
private void HandleInjection(EntityUid uid, SolutionInjectOnCollideComponent component, StartCollideEvent args)
|
private void HandleInjection(EntityUid uid, SolutionInjectOnCollideComponent component, StartCollideEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<BloodstreamComponent?>(args.OtherFixture.Body.Owner, out var bloodstream) ||
|
if (!EntityManager.TryGetComponent<BloodstreamComponent?>(args.OtherFixture.Body.Owner, out var bloodstream) ||
|
||||||
!_solutionsSystem.TryGetInjectableSolution(component.Owner, out var solution)) return;
|
!_solutionsSystem.TryGetInjectableSolution(component.Owner, out var solution)) return;
|
||||||
|
|
||||||
var solRemoved = solution.SplitSolution(component.TransferAmount);
|
var solRemoved = solution.SplitSolution(component.TransferAmount);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
if (!args.CanAccess || !args.CanInteract || !component.CanChangeTransferAmount)
|
if (!args.CanAccess || !args.CanInteract || !component.CanChangeTransferAmount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User, out var actor))
|
if (!EntityManager.TryGetComponent<ActorComponent?>(args.User, out var actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Custom transfer verb
|
// Custom transfer verb
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
var spriteSpec =
|
var spriteSpec =
|
||||||
new SpriteSpecifier.Rsi(
|
new SpriteSpecifier.Rsi(
|
||||||
new ResourcePath("Objects/Consumable/Drinks/" + proto.SpriteReplacementPath), "icon");
|
new ResourcePath("Objects/Consumable/Drinks/" + proto.SpriteReplacementPath), "icon");
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out SpriteComponent? sprite))
|
if (EntityManager.TryGetComponent(owner, out SpriteComponent? sprite))
|
||||||
{
|
{
|
||||||
sprite?.LayerSetSprite(0, spriteSpec);
|
sprite?.LayerSetSprite(0, spriteSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
string val = proto.Name + " glass";
|
string val = proto.Name + " glass";
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owner).EntityName = val;
|
EntityManager.GetComponent<MetaDataComponent>(owner).EntityName = val;
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owner).EntityDescription = proto.Description;
|
EntityManager.GetComponent<MetaDataComponent>(owner).EntityDescription = proto.Description;
|
||||||
component.CurrentReagent = proto;
|
component.CurrentReagent = proto;
|
||||||
component.Transformed = true;
|
component.Transformed = true;
|
||||||
}
|
}
|
||||||
@@ -68,14 +68,14 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
component.CurrentReagent = null;
|
component.CurrentReagent = null;
|
||||||
component.Transformed = false;
|
component.Transformed = false;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SpriteComponent? sprite) &&
|
if (EntityManager.TryGetComponent(component.Owner, out SpriteComponent? sprite) &&
|
||||||
component.InitialSprite != null)
|
component.InitialSprite != null)
|
||||||
{
|
{
|
||||||
sprite.LayerSetSprite(0, component.InitialSprite);
|
sprite.LayerSetSprite(0, component.InitialSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityName = component.InitialName;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = component.InitialName;
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityDescription = component.InitialDescription;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityDescription = component.InitialDescription;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
vapor.Target = target;
|
vapor.Target = target;
|
||||||
vapor.AliveTime = aliveTime;
|
vapor.AliveTime = aliveTime;
|
||||||
// Set Move
|
// Set Move
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(vapor.Owner, out PhysicsComponent? physics))
|
if (EntityManager.TryGetComponent(vapor.Owner, out PhysicsComponent? physics))
|
||||||
{
|
{
|
||||||
physics.BodyStatus = BodyStatus.InAir;
|
physics.BodyStatus = BodyStatus.InAir;
|
||||||
physics.ApplyLinearImpulse(dir * speed);
|
physics.ApplyLinearImpulse(dir * speed);
|
||||||
@@ -97,12 +97,12 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
vapor.Timer += frameTime;
|
vapor.Timer += frameTime;
|
||||||
vapor.ReactTimer += frameTime;
|
vapor.ReactTimer += frameTime;
|
||||||
|
|
||||||
if (vapor.ReactTimer >= ReactTime && IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(vapor.Owner).GridID.IsValid())
|
if (vapor.ReactTimer >= ReactTime && EntityManager.GetComponent<TransformComponent>(vapor.Owner).GridID.IsValid())
|
||||||
{
|
{
|
||||||
vapor.ReactTimer = 0;
|
vapor.ReactTimer = 0;
|
||||||
var mapGrid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID);
|
var mapGrid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(entity).GridID);
|
||||||
|
|
||||||
var tile = mapGrid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates.ToVector2i(EntityManager, _mapManager));
|
var tile = mapGrid.GetTileRef(EntityManager.GetComponent<TransformComponent>(entity).Coordinates.ToVector2i(EntityManager, _mapManager));
|
||||||
foreach (var reagentQuantity in contents.Contents.ToArray())
|
foreach (var reagentQuantity in contents.Contents.ToArray())
|
||||||
{
|
{
|
||||||
if (reagentQuantity.Quantity == FixedPoint2.Zero) continue;
|
if (reagentQuantity.Quantity == FixedPoint2.Zero) continue;
|
||||||
@@ -114,7 +114,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
|
|
||||||
// Check if we've reached our target.
|
// Check if we've reached our target.
|
||||||
if (!vapor.Reached &&
|
if (!vapor.Reached &&
|
||||||
vapor.Target.TryDistance(EntityManager, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates, out var distance) &&
|
vapor.Target.TryDistance(EntityManager, EntityManager.GetComponent<TransformComponent>(entity).Coordinates, out var distance) &&
|
||||||
distance <= 0.5f)
|
distance <= 0.5f)
|
||||||
{
|
{
|
||||||
vapor.Reached = true;
|
vapor.Reached = true;
|
||||||
@@ -123,7 +123,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
if (contents.CurrentVolume == 0 || vapor.Timer > vapor.AliveTime)
|
if (contents.CurrentVolume == 0 || vapor.Timer > vapor.AliveTime)
|
||||||
{
|
{
|
||||||
// Delete this
|
// Delete this
|
||||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity);
|
EntityManager.QueueDeleteEntity(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Content.Server.Climbing
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Check that the user climb.
|
// Check that the user climb.
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ClimbingComponent? climbingComponent) ||
|
if (!EntityManager.TryGetComponent(args.User, out ClimbingComponent? climbingComponent) ||
|
||||||
climbingComponent.IsClimbing)
|
climbingComponent.IsClimbing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ namespace Content.Server.Construction
|
|||||||
{
|
{
|
||||||
if (GetCurrentGraph(uid, construction) is not {} graph)
|
if (GetCurrentGraph(uid, construction) is not {} graph)
|
||||||
{
|
{
|
||||||
_sawmill.Warning($"Prototype {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
|
_sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetNodeFromGraph(graph, construction.Node) is not {} node)
|
if (GetNodeFromGraph(graph, construction.Node) is not {} node)
|
||||||
{
|
{
|
||||||
_sawmill.Warning($"Prototype {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid node specified.");
|
_sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid node specified.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ namespace Content.Server.Construction
|
|||||||
{
|
{
|
||||||
if (GetEdgeFromNode(node, edgeIndex) is not {} currentEdge)
|
if (GetEdgeFromNode(node, edgeIndex) is not {} currentEdge)
|
||||||
{
|
{
|
||||||
_sawmill.Warning($"Prototype {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
|
_sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ namespace Content.Server.Construction
|
|||||||
{
|
{
|
||||||
if (GetNodeFromGraph(graph, targetNodeId) is not { } targetNode)
|
if (GetNodeFromGraph(graph, targetNodeId) is not { } targetNode)
|
||||||
{
|
{
|
||||||
_sawmill.Warning($"Prototype {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
|
_sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(construction.Owner).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ namespace Content.Server.Conveyor
|
|||||||
|
|
||||||
private void UpdateAppearance(ConveyorComponent component)
|
private void UpdateAppearance(ConveyorComponent component)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<AppearanceComponent?>(component.Owner, out var appearance))
|
if (EntityManager.TryGetComponent<AppearanceComponent?>(component.Owner, out var appearance))
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ApcPowerReceiverComponent?>(component.Owner, out var receiver) && receiver.Powered)
|
if (EntityManager.TryGetComponent<ApcPowerReceiverComponent?>(component.Owner, out var receiver) && receiver.Powered)
|
||||||
{
|
{
|
||||||
appearance.SetData(ConveyorVisuals.State, component.State);
|
appearance.SetData(ConveyorVisuals.State, component.State);
|
||||||
}
|
}
|
||||||
@@ -98,13 +98,13 @@ namespace Content.Server.Conveyor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) &&
|
if (EntityManager.TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) &&
|
||||||
!receiver.Powered)
|
!receiver.Powered)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<ItemComponent>(component.Owner))
|
if (EntityManager.HasComponent<ItemComponent>(component.Owner))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ namespace Content.Server.Conveyor
|
|||||||
var adjustment = component.State == ConveyorState.Reversed ? MathHelper.Pi/2 : -MathHelper.Pi/2;
|
var adjustment = component.State == ConveyorState.Reversed ? MathHelper.Pi/2 : -MathHelper.Pi/2;
|
||||||
var radians = MathHelper.DegreesToRadians(component.Angle);
|
var radians = MathHelper.DegreesToRadians(component.Angle);
|
||||||
|
|
||||||
return new Angle(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation.Theta + radians + adjustment);
|
return new Angle(EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation.Theta + radians + adjustment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<(EntityUid, IPhysBody)> GetEntitiesToMove(ConveyorComponent comp)
|
public IEnumerable<(EntityUid, IPhysBody)> GetEntitiesToMove(ConveyorComponent comp)
|
||||||
@@ -132,7 +132,7 @@ namespace Content.Server.Conveyor
|
|||||||
//todo uuuhhh cache this
|
//todo uuuhhh cache this
|
||||||
foreach (var entity in _entityLookup.GetEntitiesIntersecting(comp.Owner, flags: LookupFlags.Approximate))
|
foreach (var entity in _entityLookup.GetEntitiesIntersecting(comp.Owner, flags: LookupFlags.Approximate))
|
||||||
{
|
{
|
||||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(entity) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted)
|
if ((!EntityManager.EntityExists(entity) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -142,13 +142,13 @@ namespace Content.Server.Conveyor
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics) ||
|
if (!EntityManager.TryGetComponent(entity, out IPhysBody? physics) ||
|
||||||
physics.BodyType == BodyType.Static || physics.BodyStatus == BodyStatus.InAir || entity.IsWeightless())
|
physics.BodyType == BodyType.Static || physics.BodyStatus == BodyStatus.InAir || entity.IsWeightless())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(entity))
|
if (EntityManager.HasComponent<IMapGridComponent>(entity))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Content.Server.Cuffs
|
|||||||
if (args.User == args.Target)
|
if (args.User == args.Target)
|
||||||
{
|
{
|
||||||
// This UncuffAttemptEvent check should probably be In MobStateSystem, not here?
|
// This UncuffAttemptEvent check should probably be In MobStateSystem, not here?
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MobStateComponent?>(args.User, out var state))
|
if (EntityManager.TryGetComponent<MobStateComponent?>(args.User, out var state))
|
||||||
{
|
{
|
||||||
// Manually check this.
|
// Manually check this.
|
||||||
if (state.IsIncapacitated())
|
if (state.IsIncapacitated())
|
||||||
@@ -101,11 +101,11 @@ namespace Content.Server.Cuffs
|
|||||||
{
|
{
|
||||||
var owner = message.Sender;
|
var owner = message.Sender;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner, out CuffableComponent? cuffable) ||
|
if (!EntityManager.TryGetComponent(owner, out CuffableComponent? cuffable) ||
|
||||||
!cuffable.Initialized) return;
|
!cuffable.Initialized) return;
|
||||||
|
|
||||||
var dirty = false;
|
var dirty = false;
|
||||||
var handCount = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<HandsComponent>(owner)?.Count ?? 0;
|
var handCount = EntityManager.GetComponentOrNull<HandsComponent>(owner)?.Count ?? 0;
|
||||||
|
|
||||||
while (cuffable.CuffedHandCount > handCount && cuffable.CuffedHandCount > 0)
|
while (cuffable.CuffedHandCount > handCount && cuffable.CuffedHandCount > 0)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ namespace Content.Server.Cuffs
|
|||||||
var entity = container.ContainedEntities[^1];
|
var entity = container.ContainedEntities[^1];
|
||||||
|
|
||||||
container.Remove(entity);
|
container.Remove(entity);
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).WorldPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).WorldPosition;
|
EntityManager.GetComponent<TransformComponent>(entity).WorldPosition = EntityManager.GetComponent<TransformComponent>(owner).WorldPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dirty)
|
if (dirty)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Server.Damage.Systems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.WeldingDamage is {} weldingDamage
|
if (component.WeldingDamage is {} weldingDamage
|
||||||
&& IoCManager.Resolve<IEntityManager>().TryGetComponent<WelderComponent?>(args.Used, out var welder)
|
&& EntityManager.TryGetComponent<WelderComponent?>(args.Used, out var welder)
|
||||||
&& welder.Lit)
|
&& welder.Lit)
|
||||||
{
|
{
|
||||||
var dmg = _damageableSystem.TryChangeDamage(args.Target, weldingDamage);
|
var dmg = _damageableSystem.TryChangeDamage(args.Target, weldingDamage);
|
||||||
@@ -40,7 +40,7 @@ namespace Content.Server.Damage.Systems
|
|||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
else if (component.DefaultDamage is {} damage
|
else if (component.DefaultDamage is {} damage
|
||||||
&& IoCManager.Resolve<IEntityManager>().TryGetComponent<ToolComponent?>(args.Used, out var tool)
|
&& EntityManager.TryGetComponent<ToolComponent?>(args.Used, out var tool)
|
||||||
&& tool.Qualities.ContainsAny(component.Tools))
|
&& tool.Qualities.ContainsAny(component.Tools))
|
||||||
{
|
{
|
||||||
var dmg = _damageableSystem.TryChangeDamage(args.Target, damage);
|
var dmg = _damageableSystem.TryChangeDamage(args.Target, damage);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Content.Server.DeviceNetwork.Systems
|
|||||||
|
|
||||||
private void OnProviderConnected(EntityUid uid, ApcNetworkComponent component, ExtensionCableSystem.ProviderConnectedEvent args)
|
private void OnProviderConnected(EntityUid uid, ApcNetworkComponent component, ExtensionCableSystem.ProviderConnectedEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Provider.Owner, out NodeContainerComponent? nodeContainer)) return;
|
if (!EntityManager.TryGetComponent(args.Provider.Owner, out NodeContainerComponent? nodeContainer)) return;
|
||||||
|
|
||||||
if (nodeContainer.TryGetNode("power", out CableNode? node))
|
if (nodeContainer.TryGetNode("power", out CableNode? node))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Content.Server.Disposal.Tube
|
|||||||
if (!args.CanAccess || !args.CanInteract)
|
if (!args.CanAccess || !args.CanInteract)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User, out var actor))
|
if (!EntityManager.TryGetComponent<ActorComponent?>(args.User, out var actor))
|
||||||
return;
|
return;
|
||||||
var player = actor.PlayerSession;
|
var player = actor.PlayerSession;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ namespace Content.Server.Disposal.Tube
|
|||||||
if (!args.CanAccess || !args.CanInteract)
|
if (!args.CanAccess || !args.CanInteract)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User, out var actor))
|
if (!EntityManager.TryGetComponent<ActorComponent?>(args.User, out var actor))
|
||||||
return;
|
return;
|
||||||
var player = actor.PlayerSession;
|
var player = actor.PlayerSession;
|
||||||
|
|
||||||
@@ -86,8 +86,8 @@ namespace Content.Server.Disposal.Tube
|
|||||||
return null;
|
return null;
|
||||||
var oppositeDirection = nextDirection.GetOpposite();
|
var oppositeDirection = nextDirection.GetOpposite();
|
||||||
|
|
||||||
var grid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(targetTube.Owner).GridID);
|
var grid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(targetTube.Owner).GridID);
|
||||||
var position = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(targetTube.Owner).Coordinates;
|
var position = EntityManager.GetComponent<TransformComponent>(targetTube.Owner).Coordinates;
|
||||||
foreach (var entity in grid.GetInDir(position, nextDirection))
|
foreach (var entity in grid.GetInDir(position, nextDirection))
|
||||||
{
|
{
|
||||||
if (!EntityManager.TryGetComponent(entity, out IDisposalTubeComponent? tube))
|
if (!EntityManager.TryGetComponent(entity, out IDisposalTubeComponent? tube))
|
||||||
|
|||||||
@@ -47,24 +47,24 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
foreach (var entity in holder.Container.ContainedEntities.ToArray())
|
foreach (var entity in holder.Container.ContainedEntities.ToArray())
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics))
|
if (EntityManager.TryGetComponent(entity, out IPhysBody? physics))
|
||||||
{
|
{
|
||||||
physics.CanCollide = true;
|
physics.CanCollide = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.Container.ForceRemove(entity);
|
holder.Container.ForceRemove(entity);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Parent == holderTransform)
|
if (EntityManager.GetComponent<TransformComponent>(entity).Parent == holderTransform)
|
||||||
{
|
{
|
||||||
if (duc != null)
|
if (duc != null)
|
||||||
{
|
{
|
||||||
// Insert into disposal unit
|
// Insert into disposal unit
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates((duc).Owner, Vector2.Zero);
|
EntityManager.GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates((duc).Owner, Vector2.Zero);
|
||||||
duc.Container.Insert(entity);
|
duc.Container.Insert(entity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).AttachParentToContainerOrGrid();
|
EntityManager.GetComponent<TransformComponent>(entity).AttachParentToContainerOrGrid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,11 +161,11 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
if (holder.TimeLeft > 0)
|
if (holder.TimeLeft > 0)
|
||||||
{
|
{
|
||||||
var progress = 1 - holder.TimeLeft / holder.StartingTime;
|
var progress = 1 - holder.TimeLeft / holder.StartingTime;
|
||||||
var origin = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(currentTube.Owner).Coordinates;
|
var origin = EntityManager.GetComponent<TransformComponent>(currentTube.Owner).Coordinates;
|
||||||
var destination = holder.CurrentDirection.ToVec();
|
var destination = holder.CurrentDirection.ToVec();
|
||||||
var newPosition = destination * progress;
|
var newPosition = destination * progress;
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(holder.Owner).Coordinates = origin.Offset(newPosition);
|
EntityManager.GetComponent<TransformComponent>(holder.Owner).Coordinates = origin.Offset(newPosition);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
#region Eventbus Handlers
|
#region Eventbus Handlers
|
||||||
private void HandleActivate(EntityUid uid, DisposalUnitComponent component, ActivateInWorldEvent args)
|
private void HandleActivate(EntityUid uid, DisposalUnitComponent component, ActivateInWorldEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
private void HandleInteractHand(EntityUid uid, DisposalUnitComponent component, InteractHandEvent args)
|
private void HandleInteractHand(EntityUid uid, DisposalUnitComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor)) return;
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) return;
|
||||||
|
|
||||||
// Duplicated code here, not sure how else to get actor inside to make UserInterface happy.
|
// Duplicated code here, not sure how else to get actor inside to make UserInterface happy.
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
private void HandleInteractUsing(EntityUid uid, DisposalUnitComponent component, InteractUsingEvent args)
|
private void HandleInteractUsing(EntityUid uid, DisposalUnitComponent component, InteractUsingEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out HandsComponent? hands))
|
if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
UpdateInterface(component, component.Powered);
|
UpdateInterface(component, component.Powered);
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<AnchorableComponent>(component.Owner))
|
if (!EntityManager.HasComponent<AnchorableComponent>(component.Owner))
|
||||||
{
|
{
|
||||||
Logger.WarningS("VitalComponentMissing", $"Disposal unit {uid} is missing an {nameof(AnchorableComponent)}");
|
Logger.WarningS("VitalComponentMissing", $"Disposal unit {uid} is missing an {nameof(AnchorableComponent)}");
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
{
|
{
|
||||||
var currentTime = GameTiming.CurTime;
|
var currentTime = GameTiming.CurTime;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Entity, out HandsComponent? hands) ||
|
if (!EntityManager.TryGetComponent(args.Entity, out HandsComponent? hands) ||
|
||||||
hands.Count == 0 ||
|
hands.Count == 0 ||
|
||||||
currentTime < component.LastExitAttempt + ExitAttemptDelay)
|
currentTime < component.LastExitAttempt + ExitAttemptDelay)
|
||||||
{
|
{
|
||||||
@@ -351,7 +351,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PhysicsComponent? disposalsBody))
|
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? disposalsBody))
|
||||||
{
|
{
|
||||||
component.RecentlyEjected.Clear();
|
component.RecentlyEjected.Clear();
|
||||||
}
|
}
|
||||||
@@ -395,7 +395,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
}
|
}
|
||||||
// This popup message doesn't appear on clicks, even when code was seperate. Unsure why.
|
// This popup message doesn't appear on clicks, even when code was seperate. Unsure why.
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<HandsComponent>(eventArgs.User))
|
if (!EntityManager.HasComponent<HandsComponent>(eventArgs.User))
|
||||||
{
|
{
|
||||||
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("ui-disposal-unit-is-valid-interaction-no-hands"));
|
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("ui-disposal-unit-is-valid-interaction-no-hands"));
|
||||||
return false;
|
return false;
|
||||||
@@ -444,8 +444,8 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var grid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).GridID);
|
var grid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(component.Owner).GridID);
|
||||||
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates;
|
var coords = EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates;
|
||||||
var entry = grid.GetLocal(coords)
|
var entry = grid.GetLocal(coords)
|
||||||
.FirstOrDefault(entity => EntityManager.HasComponent<DisposalEntryComponent>(entity));
|
.FirstOrDefault(entity => EntityManager.HasComponent<DisposalEntryComponent>(entity));
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
var air = component.Air;
|
var air = component.Air;
|
||||||
var entryComponent = EntityManager.GetComponent<DisposalEntryComponent>(entry);
|
var entryComponent = EntityManager.GetComponent<DisposalEntryComponent>(entry);
|
||||||
|
|
||||||
if (_atmosSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates, true) is {Temperature: > 0} environment)
|
if (_atmosSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates, true) is {Temperature: > 0} environment)
|
||||||
{
|
{
|
||||||
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - air.Pressure) * air.Volume / (environment.Temperature * Atmospherics.R);
|
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - air.Pressure) * air.Volume / (environment.Temperature * Atmospherics.R);
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
public void UpdateInterface(DisposalUnitComponent component, bool powered)
|
public void UpdateInterface(DisposalUnitComponent component, bool powered)
|
||||||
{
|
{
|
||||||
var stateString = Loc.GetString($"{component.State}");
|
var stateString = Loc.GetString($"{component.State}");
|
||||||
var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityName, stateString, EstimatedFullPressure(component), powered, component.Engaged);
|
var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName, stateString, EstimatedFullPressure(component), powered, component.Engaged);
|
||||||
component.UserInterface?.SetState(state);
|
component.UserInterface?.SetState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,12 +504,12 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
public void UpdateVisualState(DisposalUnitComponent component, bool flush)
|
public void UpdateVisualState(DisposalUnitComponent component, bool flush)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
if (!EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
{
|
{
|
||||||
appearance.SetData(SharedDisposalUnitComponent.Visuals.VisualState, SharedDisposalUnitComponent.VisualState.UnAnchored);
|
appearance.SetData(SharedDisposalUnitComponent.Visuals.VisualState, SharedDisposalUnitComponent.VisualState.UnAnchored);
|
||||||
appearance.SetData(SharedDisposalUnitComponent.Visuals.Handle, SharedDisposalUnitComponent.HandleState.Normal);
|
appearance.SetData(SharedDisposalUnitComponent.Visuals.Handle, SharedDisposalUnitComponent.HandleState.Normal);
|
||||||
@@ -567,7 +567,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
|
|
||||||
public bool CanFlush(DisposalUnitComponent component)
|
public bool CanFlush(DisposalUnitComponent component)
|
||||||
{
|
{
|
||||||
return component.State == SharedDisposalUnitComponent.PressureState.Ready && component.Powered && IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored;
|
return component.State == SharedDisposalUnitComponent.PressureState.Ready && component.Powered && EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Engage(DisposalUnitComponent component)
|
public void Engage(DisposalUnitComponent component)
|
||||||
@@ -633,7 +633,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
{
|
{
|
||||||
TryQueueEngage(component);
|
TryQueueEngage(component);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out ActorComponent? actor))
|
if (EntityManager.TryGetComponent(entity, out ActorComponent? actor))
|
||||||
{
|
{
|
||||||
component.UserInterface?.Close(actor.PlayerSession);
|
component.UserInterface?.Close(actor.PlayerSession);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Content.Server.Doors.Systems
|
|||||||
private void OnDoorClickShouldActivate(EntityUid uid, AirlockComponent component, DoorClickShouldActivateEvent args)
|
private void OnDoorClickShouldActivate(EntityUid uid, AirlockComponent component, DoorClickShouldActivateEvent args)
|
||||||
{
|
{
|
||||||
if (component.WiresComponent != null && component.WiresComponent.IsPanelOpen &&
|
if (component.WiresComponent != null && component.WiresComponent.IsPanelOpen &&
|
||||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Args.User, out ActorComponent? actor))
|
EntityManager.TryGetComponent(args.Args.User, out ActorComponent? actor))
|
||||||
{
|
{
|
||||||
component.WiresComponent.OpenInterface(actor.PlayerSession);
|
component.WiresComponent.OpenInterface(actor.PlayerSession);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Content.Server.Doors
|
|||||||
|
|
||||||
private void HandleCollide(EntityUid uid, ServerDoorComponent component, StartCollideEvent args)
|
private void HandleCollide(EntityUid uid, ServerDoorComponent component, StartCollideEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<DoorBumpOpenerComponent>(args.OtherFixture.Body.Owner))
|
if (!EntityManager.HasComponent<DoorBumpOpenerComponent>(args.OtherFixture.Body.Owner))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace Content.Server.Electrocution
|
|||||||
foreach (var entity in transform.Coordinates.GetEntitiesInTile(
|
foreach (var entity in transform.Coordinates.GetEntitiesInTile(
|
||||||
LookupFlags.Approximate | LookupFlags.IncludeAnchored, _entityLookup))
|
LookupFlags.Approximate | LookupFlags.IncludeAnchored, _entityLookup))
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<WindowComponent>(entity))
|
if (EntityManager.HasComponent<WindowComponent>(entity))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,10 +285,10 @@ namespace Content.Server.Electrocution
|
|||||||
var electrocutionEntity = EntityManager.SpawnEntity(
|
var electrocutionEntity = EntityManager.SpawnEntity(
|
||||||
$"VirtualElectrocutionLoad{node.NodeGroupID}", sourceTransform.Coordinates);
|
$"VirtualElectrocutionLoad{node.NodeGroupID}", sourceTransform.Coordinates);
|
||||||
|
|
||||||
var electrocutionNode = IoCManager.Resolve<IEntityManager>().GetComponent<NodeContainerComponent>(electrocutionEntity)
|
var electrocutionNode = EntityManager.GetComponent<NodeContainerComponent>(electrocutionEntity)
|
||||||
.GetNode<ElectrocutionNode>("electrocution");
|
.GetNode<ElectrocutionNode>("electrocution");
|
||||||
|
|
||||||
var electrocutionComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ElectrocutionComponent>(electrocutionEntity);
|
var electrocutionComponent = EntityManager.GetComponent<ElectrocutionComponent>(electrocutionEntity);
|
||||||
|
|
||||||
electrocutionNode.CableEntity = sourceUid;
|
electrocutionNode.CableEntity = sourceUid;
|
||||||
electrocutionNode.NodeName = node.Name;
|
electrocutionNode.NodeName = node.Name;
|
||||||
|
|||||||
@@ -41,18 +41,18 @@ namespace Content.Server.Engineering.EntitySystems
|
|||||||
component.TokenSource.Cancel();
|
component.TokenSource.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.Deleted || (!IoCManager.Resolve<IEntityManager>().EntityExists(component.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
if (component.Deleted || (!EntityManager.EntityExists(component.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var entity = EntityManager.SpawnEntity(component.Prototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates);
|
var entity = EntityManager.SpawnEntity(component.Prototype, EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<HandsComponent?>(args.User, out var hands)
|
if (EntityManager.TryGetComponent<HandsComponent?>(args.User, out var hands)
|
||||||
&& IoCManager.Resolve<IEntityManager>().TryGetComponent<ItemComponent?>(entity, out var item))
|
&& EntityManager.TryGetComponent<ItemComponent?>(entity, out var item))
|
||||||
{
|
{
|
||||||
hands.PutInHandOrDrop(item);
|
hands.PutInHandOrDrop(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
EntityManager.DeleteEntity(component.Owner);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ namespace Content.Server.Engineering.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.Deleted || (!IoCManager.Resolve<IEntityManager>().EntityExists(component.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
if (component.Deleted || (!EntityManager.EntityExists(component.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedStackComponent?>(component.Owner, out var stackComp)
|
if (EntityManager.TryGetComponent<SharedStackComponent?>(component.Owner, out var stackComp)
|
||||||
&& component.RemoveOnInteract && !_stackSystem.Use(uid, 1, stackComp))
|
&& component.RemoveOnInteract && !_stackSystem.Use(uid, 1, stackComp))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -68,8 +68,8 @@ namespace Content.Server.Engineering.EntitySystems
|
|||||||
|
|
||||||
EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid));
|
EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid));
|
||||||
|
|
||||||
if (component.RemoveOnInteract && stackComp == null && !((!IoCManager.Resolve<IEntityManager>().EntityExists(component.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted))
|
if (component.RemoveOnInteract && stackComp == null && !((!EntityManager.EntityExists(component.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted))
|
||||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
EntityManager.DeleteEntity(component.Owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Content.Server.Explosion.EntitySystems
|
|||||||
|
|
||||||
Timer.Spawn(delay, () =>
|
Timer.Spawn(delay, () =>
|
||||||
{
|
{
|
||||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(triggered) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(triggered).EntityLifeStage) >= EntityLifeStage.Deleted) return;
|
if (Deleted(triggered)) return;
|
||||||
Trigger(triggered, user);
|
Trigger(triggered, user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Content.Server.Flash
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<FlashableComponent>(args.Entity))
|
if (EntityManager.HasComponent<FlashableComponent>(args.Entity))
|
||||||
{
|
{
|
||||||
args.CanInteract = true;
|
args.CanInteract = true;
|
||||||
Flash(args.Entity, args.User, uid, comp.FlashDuration, comp.SlowTo);
|
Flash(args.Entity, args.User, uid, comp.FlashDuration, comp.SlowTo);
|
||||||
@@ -75,7 +75,7 @@ namespace Content.Server.Flash
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var entity in _entityLookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).Coordinates, comp.Range))
|
foreach (var entity in _entityLookup.GetEntitiesInRange(EntityManager.GetComponent<TransformComponent>(comp.Owner).Coordinates, comp.Range))
|
||||||
{
|
{
|
||||||
Flash(entity, args.User, uid, comp.AoeFlashDuration, comp.SlowTo);
|
Flash(entity, args.User, uid, comp.AoeFlashDuration, comp.SlowTo);
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ namespace Content.Server.Flash
|
|||||||
if (comp.HasUses)
|
if (comp.HasUses)
|
||||||
{
|
{
|
||||||
// TODO flash visualizer
|
// TODO flash visualizer
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite))
|
if (!EntityManager.TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (--comp.Uses == 0)
|
if (--comp.Uses == 0)
|
||||||
@@ -149,7 +149,7 @@ namespace Content.Server.Flash
|
|||||||
|
|
||||||
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
|
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<FlashableComponent>(entity) ||
|
if (!EntityManager.HasComponent<FlashableComponent>(entity) ||
|
||||||
!transform.InRangeUnobstructed(entity, range, CollisionGroup.Opaque)) continue;
|
!transform.InRangeUnobstructed(entity, range, CollisionGroup.Opaque)) continue;
|
||||||
|
|
||||||
Flash(entity, user, source, duration, slowTo, displayPopup);
|
Flash(entity, user, source, duration, slowTo, displayPopup);
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ namespace Content.Server.Gravity.EntitySystems
|
|||||||
|
|
||||||
private void UpdateGravityActive(GravityGeneratorComponent grav, bool shake)
|
private void UpdateGravityActive(GravityGeneratorComponent grav, bool shake)
|
||||||
{
|
{
|
||||||
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(grav.Owner).GridID;
|
var gridId = EntityManager.GetComponent<TransformComponent>(grav.Owner).GridID;
|
||||||
if (gridId == GridId.Invalid)
|
if (gridId == GridId.Invalid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ namespace Content.Server.Gravity.EntitySystems
|
|||||||
private void HandleGravityInitialize(EntityUid uid, GravityComponent component, ComponentInit args)
|
private void HandleGravityInitialize(EntityUid uid, GravityComponent component, ComponentInit args)
|
||||||
{
|
{
|
||||||
// Incase there's already a generator on the grid we'll just set it now.
|
// Incase there's already a generator on the grid we'll just set it now.
|
||||||
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).GridID;
|
var gridId = EntityManager.GetComponent<TransformComponent>(component.Owner).GridID;
|
||||||
GravityChangedMessage message;
|
GravityChangedMessage message;
|
||||||
|
|
||||||
foreach (var generator in EntityManager.EntityQuery<GravityGeneratorComponent>())
|
foreach (var generator in EntityManager.EntityQuery<GravityGeneratorComponent>())
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(generator.Owner).GridID == gridId && generator.GravityActive)
|
if (EntityManager.GetComponent<TransformComponent>(generator.Owner).GridID == gridId && generator.GravityActive)
|
||||||
{
|
{
|
||||||
component.Enabled = true;
|
component.Enabled = true;
|
||||||
message = new GravityChangedMessage(gridId, true);
|
message = new GravityChangedMessage(gridId, true);
|
||||||
@@ -41,7 +41,7 @@ namespace Content.Server.Gravity.EntitySystems
|
|||||||
if (comp.Enabled) return;
|
if (comp.Enabled) return;
|
||||||
comp.Enabled = true;
|
comp.Enabled = true;
|
||||||
|
|
||||||
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).GridID;
|
var gridId = EntityManager.GetComponent<TransformComponent>(comp.Owner).GridID;
|
||||||
var message = new GravityChangedMessage(gridId, true);
|
var message = new GravityChangedMessage(gridId, true);
|
||||||
RaiseLocalEvent(message);
|
RaiseLocalEvent(message);
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ namespace Content.Server.Gravity.EntitySystems
|
|||||||
if (!comp.Enabled) return;
|
if (!comp.Enabled) return;
|
||||||
comp.Enabled = false;
|
comp.Enabled = false;
|
||||||
|
|
||||||
var gridId = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).GridID;
|
var gridId = EntityManager.GetComponent<TransformComponent>(comp.Owner).GridID;
|
||||||
var message = new GravityChangedMessage(gridId, false);
|
var message = new GravityChangedMessage(gridId, false);
|
||||||
RaiseLocalEvent(message);
|
RaiseLocalEvent(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace Content.Server.Labels
|
|||||||
LabelComponent label = target.EnsureComponent<LabelComponent>();
|
LabelComponent label = target.EnsureComponent<LabelComponent>();
|
||||||
|
|
||||||
if (label.OriginalName != null)
|
if (label.OriginalName != null)
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName = label.OriginalName;
|
EntityManager.GetComponent<MetaDataComponent>(target).EntityName = label.OriginalName;
|
||||||
label.OriginalName = null;
|
label.OriginalName = null;
|
||||||
|
|
||||||
if (handLabeler.AssignedLabel == string.Empty)
|
if (handLabeler.AssignedLabel == string.Empty)
|
||||||
@@ -63,16 +63,16 @@ namespace Content.Server.Labels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
label.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName;
|
label.OriginalName = EntityManager.GetComponent<MetaDataComponent>(target).EntityName;
|
||||||
string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName + $" ({handLabeler.AssignedLabel})";
|
string val = EntityManager.GetComponent<MetaDataComponent>(target).EntityName + $" ({handLabeler.AssignedLabel})";
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName = val;
|
EntityManager.GetComponent<MetaDataComponent>(target).EntityName = val;
|
||||||
label.CurrentLabel = handLabeler.AssignedLabel;
|
label.CurrentLabel = handLabeler.AssignedLabel;
|
||||||
result = Loc.GetString("hand-labeler-successfully-applied");
|
result = Loc.GetString("hand-labeler-successfully-applied");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUseInHand(EntityUid uid, HandLabelerComponent handLabeler, UseInHandEvent args)
|
private void OnUseInHand(EntityUid uid, HandLabelerComponent handLabeler, UseInHandEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
handLabeler.Owner.GetUIOrNull(HandLabelerUiKey.Key)?.Open(actor.PlayerSession);
|
handLabeler.Owner.GetUIOrNull(HandLabelerUiKey.Key)?.Open(actor.PlayerSession);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
|
|
||||||
// try get first inserted bulb of the same type as targeted light fixtutre
|
// try get first inserted bulb of the same type as targeted light fixtutre
|
||||||
var bulb = replacer.InsertedBulbs.ContainedEntities.FirstOrDefault(
|
var bulb = replacer.InsertedBulbs.ContainedEntities.FirstOrDefault(
|
||||||
(e) => IoCManager.Resolve<IEntityManager>().GetComponentOrNull<LightBulbComponent>(e)?.Type == fixture.BulbType);
|
(e) => EntityManager.GetComponentOrNull<LightBulbComponent>(e)?.Type == fixture.BulbType);
|
||||||
|
|
||||||
// found bulb in inserted storage
|
// found bulb in inserted storage
|
||||||
if (bulb != null)
|
if (bulb != null)
|
||||||
@@ -123,7 +123,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
// found right bulb, let's spawn it
|
// found right bulb, let's spawn it
|
||||||
if (bulbEnt != null)
|
if (bulbEnt != null)
|
||||||
{
|
{
|
||||||
bulb = EntityManager.SpawnEntity(bulbEnt.PrototypeName, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(replacer.Owner).Coordinates);
|
bulb = EntityManager.SpawnEntity(bulbEnt.PrototypeName, EntityManager.GetComponent<TransformComponent>(replacer.Owner).Coordinates);
|
||||||
bulbEnt.Amount--;
|
bulbEnt.Amount--;
|
||||||
}
|
}
|
||||||
// not found any light bulbs
|
// not found any light bulbs
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
if (match.CurrentState != SmokableState.Lit)
|
if (match.CurrentState != SmokableState.Lit)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_atmosphereSystem.HotspotExpose(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(match.Owner).Coordinates, 400, 50, true);
|
_atmosphereSystem.HotspotExpose(EntityManager.GetComponent<TransformComponent>(match.Owner).Coordinates, 400, 50, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
component.PointLightComponent.Enabled = component.CurrentState == SmokableState.Lit;
|
component.PointLightComponent.Enabled = component.CurrentState == SmokableState.Lit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out ItemComponent? item))
|
if (EntityManager.TryGetComponent(component.Owner, out ItemComponent? item))
|
||||||
{
|
{
|
||||||
switch (component.CurrentState)
|
switch (component.CurrentState)
|
||||||
{
|
{
|
||||||
@@ -97,7 +97,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
appearance.SetData(SmokingVisuals.Smoking, component.CurrentState);
|
appearance.SetData(SmokingVisuals.Smoking, component.CurrentState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
|
|
||||||
public void ToggleLight(UnpoweredFlashlightComponent flashlight)
|
public void ToggleLight(UnpoweredFlashlightComponent flashlight)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(flashlight.Owner, out PointLightComponent? light))
|
if (!EntityManager.TryGetComponent(flashlight.Owner, out PointLightComponent? light))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flashlight.LightOn = !flashlight.LightOn;
|
flashlight.LightOn = !flashlight.LightOn;
|
||||||
light.Enabled = flashlight.LightOn;
|
light.Enabled = flashlight.LightOn;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(flashlight.Owner, out AppearanceComponent? appearance))
|
if (EntityManager.TryGetComponent(flashlight.Owner, out AppearanceComponent? appearance))
|
||||||
appearance.SetData(UnpoweredFlashlightVisuals.LightOn, flashlight.LightOn);
|
appearance.SetData(UnpoweredFlashlightVisuals.LightOn, flashlight.LightOn);
|
||||||
|
|
||||||
SoundSystem.Play(Filter.Pvs(light.Owner), flashlight.ToggleSound.GetSound(), flashlight.Owner);
|
SoundSystem.Play(Filter.Pvs(light.Owner), flashlight.ToggleSound.GetSound(), flashlight.Owner);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Content.Server.Lock
|
|||||||
|
|
||||||
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(lockComp.Owner, out AppearanceComponent? appearance))
|
if (EntityManager.TryGetComponent(lockComp.Owner, out AppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
appearance.SetData(StorageVisuals.CanLock, true);
|
appearance.SetData(StorageVisuals.CanLock, true);
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ namespace Content.Server.Lock
|
|||||||
args.PushText(Loc.GetString(lockComp.Locked
|
args.PushText(Loc.GetString(lockComp.Locked
|
||||||
? "lock-comp-on-examined-is-locked"
|
? "lock-comp-on-examined-is-locked"
|
||||||
: "lock-comp-on-examined-is-unlocked",
|
: "lock-comp-on-examined-is-unlocked",
|
||||||
("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryLock(EntityUid uid, EntityUid user, LockComponent? lockComp = null)
|
public bool TryLock(EntityUid uid, EntityUid user, LockComponent? lockComp = null)
|
||||||
@@ -78,7 +78,7 @@ namespace Content.Server.Lock
|
|||||||
if (!HasUserAccess(uid, user, quiet: false))
|
if (!HasUserAccess(uid, user, quiet: false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||||
lockComp.Locked = true;
|
lockComp.Locked = true;
|
||||||
|
|
||||||
if(lockComp.LockSound != null)
|
if(lockComp.LockSound != null)
|
||||||
@@ -86,7 +86,7 @@ namespace Content.Server.Lock
|
|||||||
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.LockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.LockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
if (EntityManager.TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
||||||
{
|
{
|
||||||
appearanceComp.SetData(StorageVisuals.Locked, true);
|
appearanceComp.SetData(StorageVisuals.Locked, true);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ namespace Content.Server.Lock
|
|||||||
if (!HasUserAccess(uid, user, quiet: false))
|
if (!HasUserAccess(uid, user, quiet: false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
|
||||||
lockComp.Locked = false;
|
lockComp.Locked = false;
|
||||||
|
|
||||||
if(lockComp.UnlockSound != null)
|
if(lockComp.UnlockSound != null)
|
||||||
@@ -115,7 +115,7 @@ namespace Content.Server.Lock
|
|||||||
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.UnlockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
SoundSystem.Play(Filter.Pvs(lockComp.Owner), lockComp.UnlockSound.GetSound(), lockComp.Owner, AudioParams.Default.WithVolume(-5));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
if (EntityManager.TryGetComponent(lockComp.Owner, out AppearanceComponent? appearanceComp))
|
||||||
{
|
{
|
||||||
appearanceComp.SetData(StorageVisuals.Locked, false);
|
appearanceComp.SetData(StorageVisuals.Locked, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Server.Medical
|
|||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
verb.Act = () => component.InsertBody(args.Using.Value);
|
verb.Act = () => component.InsertBody(args.Using.Value);
|
||||||
verb.Category = VerbCategory.Insert;
|
verb.Category = VerbCategory.Insert;
|
||||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Value).EntityName;
|
verb.Text = EntityManager.GetComponent<MetaDataComponent>(args.Using.Value).EntityName;
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
|||||||
{
|
{
|
||||||
SoundSystem.Play(Filter.Pvs(creamPie.Owner), creamPie.Sound.GetSound(), creamPie.Owner, AudioHelpers.WithVariation(0.125f));
|
SoundSystem.Play(Filter.Pvs(creamPie.Owner), creamPie.Sound.GetSound(), creamPie.Owner, AudioHelpers.WithVariation(0.125f));
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<FoodComponent?>(creamPie.Owner, out var foodComp) && _solutionsSystem.TryGetSolution(creamPie.Owner, foodComp.SolutionName, out var solution))
|
if (EntityManager.TryGetComponent<FoodComponent?>(creamPie.Owner, out var foodComp) && _solutionsSystem.TryGetSolution(creamPie.Owner, foodComp.SolutionName, out var solution))
|
||||||
{
|
{
|
||||||
_spillableSystem.SpillAt(creamPie.Owner, solution, "PuddleSmear", false);
|
_spillableSystem.SpillAt(creamPie.Owner, solution, "PuddleSmear", false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
|||||||
if (_robustRandom.Prob(component.BreakChance))
|
if (_robustRandom.Prob(component.BreakChance))
|
||||||
{
|
{
|
||||||
SoundSystem.Play(Filter.Pvs(userUid), component.BreakSound.GetSound(), userUid, AudioParams.Default.WithVolume(-2f));
|
SoundSystem.Play(Filter.Pvs(userUid), component.BreakSound.GetSound(), userUid, AudioParams.Default.WithVolume(-2f));
|
||||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
EntityManager.DeleteEntity(component.Owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace Content.Server.PAI
|
|||||||
|
|
||||||
// Ownership tag
|
// Ownership tag
|
||||||
string val = Loc.GetString("pai-system-pai-name", ("owner", args.User));
|
string val = Loc.GetString("pai-system-pai-name", ("owner", args.User));
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
|
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
|
||||||
|
|
||||||
var ghostFinder = EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid);
|
var ghostFinder = EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid);
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Content.Server.PDA
|
|||||||
private void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args)
|
private void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args)
|
||||||
{
|
{
|
||||||
if (args.Container.ID == pda.IdSlot.ID)
|
if (args.Container.ID == pda.IdSlot.ID)
|
||||||
pda.ContainedID = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<IdCardComponent>(args.Entity);
|
pda.ContainedID = EntityManager.GetComponentOrNull<IdCardComponent>(args.Entity);
|
||||||
|
|
||||||
UpdatePDAAppearance(pda);
|
UpdatePDAAppearance(pda);
|
||||||
UpdatePDAUserInterface(pda);
|
UpdatePDAUserInterface(pda);
|
||||||
@@ -112,7 +112,7 @@ namespace Content.Server.PDA
|
|||||||
|
|
||||||
private bool OpenUI(PDAComponent pda, EntityUid user)
|
private bool OpenUI(PDAComponent pda, EntityUid user)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(user, out ActorComponent? actor))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key);
|
var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key);
|
||||||
@@ -123,7 +123,7 @@ namespace Content.Server.PDA
|
|||||||
|
|
||||||
private void UpdatePDAAppearance(PDAComponent pda)
|
private void UpdatePDAAppearance(PDAComponent pda)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(pda.Owner, out AppearanceComponent? appearance))
|
if (EntityManager.TryGetComponent(pda.Owner, out AppearanceComponent? appearance))
|
||||||
appearance.SetData(PDAVisuals.IDCardInserted, pda.ContainedID != null);
|
appearance.SetData(PDAVisuals.IDCardInserted, pda.ContainedID != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ namespace Content.Server.PDA
|
|||||||
JobTitle = pda.ContainedID?.JobTitle
|
JobTitle = pda.ContainedID?.JobTitle
|
||||||
};
|
};
|
||||||
|
|
||||||
var hasUplink = IoCManager.Resolve<IEntityManager>().HasComponent<UplinkComponent>(pda.Owner);
|
var hasUplink = EntityManager.HasComponent<UplinkComponent>(pda.Owner);
|
||||||
|
|
||||||
var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key);
|
var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key);
|
||||||
ui?.SetState(new PDAUpdateState(pda.FlashlightOn, pda.PenSlot.HasItem, ownerInfo, hasUplink));
|
ui?.SetState(new PDAUpdateState(pda.FlashlightOn, pda.PenSlot.HasItem, ownerInfo, hasUplink));
|
||||||
@@ -155,7 +155,7 @@ namespace Content.Server.PDA
|
|||||||
break;
|
break;
|
||||||
case PDAToggleFlashlightMessage _:
|
case PDAToggleFlashlightMessage _:
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(pda.Owner, out UnpoweredFlashlightComponent? flashlight))
|
if (EntityManager.TryGetComponent(pda.Owner, out UnpoweredFlashlightComponent? flashlight))
|
||||||
_unpoweredFlashlight.ToggleLight(flashlight);
|
_unpoweredFlashlight.ToggleLight(flashlight);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ namespace Content.Server.PDA
|
|||||||
}
|
}
|
||||||
case PDAShowUplinkMessage _:
|
case PDAShowUplinkMessage _:
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(pda.Owner, out UplinkComponent? uplink))
|
if (EntityManager.TryGetComponent(pda.Owner, out UplinkComponent? uplink))
|
||||||
_uplinkSystem.ToggleUplinkUI(uplink, msg.Session);
|
_uplinkSystem.ToggleUplinkUI(uplink, msg.Session);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Content.Server.ParticleAccelerator.EntitySystems
|
|||||||
|
|
||||||
private static void RotateEvent(ref RotateEvent ev)
|
private static void RotateEvent(ref RotateEvent ev)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(ev.Sender, out ParticleAcceleratorPartComponent? part))
|
if (EntityManager.TryGetComponent(ev.Sender, out ParticleAcceleratorPartComponent? part))
|
||||||
{
|
{
|
||||||
part.Rotated();
|
part.Rotated();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Content.Server.Pinpointer
|
|||||||
{
|
{
|
||||||
if (whitelist.IsValid(e))
|
if (whitelist.IsValid(e))
|
||||||
{
|
{
|
||||||
var dist = (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(e).WorldPosition - transform.WorldPosition).LengthSquared;
|
var dist = (EntityManager.GetComponent<TransformComponent>(e).WorldPosition - transform.WorldPosition).LengthSquared;
|
||||||
l.TryAdd(dist, e);
|
l.TryAdd(dist, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Content.Server.Pointing.EntitySystems
|
|||||||
|
|
||||||
if (component.TurningDelay > 0)
|
if (component.TurningDelay > 0)
|
||||||
{
|
{
|
||||||
var difference = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chasing).WorldPosition - transform.WorldPosition;
|
var difference = EntityManager.GetComponent<TransformComponent>(chasing).WorldPosition - transform.WorldPosition;
|
||||||
var angle = difference.ToAngle();
|
var angle = difference.ToAngle();
|
||||||
var adjusted = angle.Degrees + 90;
|
var adjusted = angle.Degrees + 90;
|
||||||
var newAngle = Angle.FromDegrees(adjusted);
|
var newAngle = Angle.FromDegrees(adjusted);
|
||||||
@@ -93,7 +93,7 @@ namespace Content.Server.Pointing.EntitySystems
|
|||||||
|
|
||||||
UpdateAppearance(uid, component, transform);
|
UpdateAppearance(uid, component, transform);
|
||||||
|
|
||||||
var toChased = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chasing).WorldPosition - transform.WorldPosition;
|
var toChased = EntityManager.GetComponent<TransformComponent>(chasing).WorldPosition - transform.WorldPosition;
|
||||||
|
|
||||||
transform.WorldPosition += toChased * frameTime * component.ChasingSpeed;
|
transform.WorldPosition += toChased * frameTime * component.ChasingSpeed;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Container.ContainedEntity!.Value).EntityName;
|
verb.Text = EntityManager.GetComponent<MetaDataComponent>(component.Container.ContainedEntity!.Value).EntityName;
|
||||||
verb.Category = VerbCategory.Eject;
|
verb.Category = VerbCategory.Eject;
|
||||||
verb.Act = () => component.RemoveItem(args.User);
|
verb.Act = () => component.RemoveItem(args.User);
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
@@ -60,7 +60,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(@using).EntityName;
|
verb.Text = EntityManager.GetComponent<MetaDataComponent>(@using).EntityName;
|
||||||
verb.Category = VerbCategory.Insert;
|
verb.Category = VerbCategory.Insert;
|
||||||
verb.Act = () => component.TryInsertItem(@using);
|
verb.Act = () => component.TryInsertItem(@using);
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
if (args.IsInDetailsRange)
|
if (args.IsInDetailsRange)
|
||||||
{
|
{
|
||||||
// Determine if they are holding a multitool.
|
// Determine if they are holding a multitool.
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<HandsComponent?>(args.Examiner, out var hands) && hands.TryGetActiveHand(out var hand))
|
if (EntityManager.TryGetComponent<HandsComponent?>(args.Examiner, out var hands) && hands.TryGetActiveHand(out var hand))
|
||||||
{
|
{
|
||||||
var held = hand.HeldEntity;
|
var held = hand.HeldEntity;
|
||||||
// Pulsing is hardcoded here because I don't think it needs to be more complex than that right now.
|
// Pulsing is hardcoded here because I don't think it needs to be more complex than that right now.
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
if (reachable is not CableNode)
|
if (reachable is not CableNode)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var otherTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(reachable.Owner);
|
var otherTransform = EntityManager.GetComponent<TransformComponent>(reachable.Owner);
|
||||||
if (otherTransform.GridID != grid.Index)
|
if (otherTransform.GridID != grid.Index)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
if (EntityManager.TryGetComponent<ExtensionCableReceiverComponent>(entity, out var receiver) &&
|
if (EntityManager.TryGetComponent<ExtensionCableReceiverComponent>(entity, out var receiver) &&
|
||||||
receiver.Connectable &&
|
receiver.Connectable &&
|
||||||
receiver.Provider == null &&
|
receiver.Provider == null &&
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates.TryDistance(IoCManager.Resolve<IEntityManager>(), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).Coordinates, out var distance) &&
|
EntityManager.GetComponent<TransformComponent>(entity).Coordinates.TryDistance(EntityManager, EntityManager.GetComponent<TransformComponent>(owner).Coordinates, out var distance) &&
|
||||||
distance < Math.Min(range, receiver.ReceptionRange))
|
distance < Math.Min(range, receiver.ReceptionRange))
|
||||||
{
|
{
|
||||||
yield return receiver;
|
yield return receiver;
|
||||||
@@ -118,7 +118,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
|
|
||||||
private void OnReceiverStarted(EntityUid uid, ExtensionCableReceiverComponent receiver, ComponentStartup args)
|
private void OnReceiverStarted(EntityUid uid, ExtensionCableReceiverComponent receiver, ComponentStartup args)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(receiver.Owner, out PhysicsComponent? physicsComponent))
|
if (EntityManager.TryGetComponent(receiver.Owner, out PhysicsComponent? physicsComponent))
|
||||||
{
|
{
|
||||||
receiver.Connectable = physicsComponent.BodyType == BodyType.Static;
|
receiver.Connectable = physicsComponent.BodyType == BodyType.Static;
|
||||||
}
|
}
|
||||||
@@ -179,11 +179,11 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
|
|
||||||
foreach (var entity in nearbyEntities)
|
foreach (var entity in nearbyEntities)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ExtensionCableProviderComponent?>(entity, out var provider)) continue;
|
if (!EntityManager.TryGetComponent<ExtensionCableProviderComponent?>(entity, out var provider)) continue;
|
||||||
|
|
||||||
if (!provider.Connectable) continue;
|
if (!provider.Connectable) continue;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates.TryDistance(IoCManager.Resolve<IEntityManager>(), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).Coordinates, out var distance)) continue;
|
if (!EntityManager.GetComponent<TransformComponent>(entity).Coordinates.TryDistance(EntityManager, EntityManager.GetComponent<TransformComponent>(owner).Coordinates, out var distance)) continue;
|
||||||
|
|
||||||
if (!(distance < Math.Min(range, provider.TransferRange))) continue;
|
if (!(distance < Math.Min(range, provider.TransferRange))) continue;
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
|
|
||||||
foreach (var apc in net.Apcs)
|
foreach (var apc in net.Apcs)
|
||||||
{
|
{
|
||||||
var netBattery = IoCManager.Resolve<IEntityManager>().GetComponent<PowerNetworkBatteryComponent>(apc.Owner);
|
var netBattery = EntityManager.GetComponent<PowerNetworkBatteryComponent>(apc.Owner);
|
||||||
netNode.BatteriesDischarging.Add(netBattery.NetworkBattery.Id);
|
netNode.BatteriesDischarging.Add(netBattery.NetworkBattery.Id);
|
||||||
netBattery.NetworkBattery.LinkedNetworkDischarging = netNode.Id;
|
netBattery.NetworkBattery.LinkedNetworkDischarging = netNode.Id;
|
||||||
}
|
}
|
||||||
@@ -372,14 +372,14 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
|
|
||||||
foreach (var charger in net.Chargers)
|
foreach (var charger in net.Chargers)
|
||||||
{
|
{
|
||||||
var battery = IoCManager.Resolve<IEntityManager>().GetComponent<PowerNetworkBatteryComponent>(charger.Owner);
|
var battery = EntityManager.GetComponent<PowerNetworkBatteryComponent>(charger.Owner);
|
||||||
netNode.BatteriesCharging.Add(battery.NetworkBattery.Id);
|
netNode.BatteriesCharging.Add(battery.NetworkBattery.Id);
|
||||||
battery.NetworkBattery.LinkedNetworkCharging = netNode.Id;
|
battery.NetworkBattery.LinkedNetworkCharging = netNode.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var discharger in net.Dischargers)
|
foreach (var discharger in net.Dischargers)
|
||||||
{
|
{
|
||||||
var battery = IoCManager.Resolve<IEntityManager>().GetComponent<PowerNetworkBatteryComponent>(discharger.Owner);
|
var battery = EntityManager.GetComponent<PowerNetworkBatteryComponent>(discharger.Owner);
|
||||||
netNode.BatteriesDischarging.Add(battery.NetworkBattery.Id);
|
netNode.BatteriesDischarging.Add(battery.NetworkBattery.Id);
|
||||||
battery.NetworkBattery.LinkedNetworkDischarging = netNode.Id;
|
battery.NetworkBattery.LinkedNetworkDischarging = netNode.Id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ namespace Content.Server.PowerCell
|
|||||||
!args.CanAccess ||
|
!args.CanAccess ||
|
||||||
!args.CanInteract ||
|
!args.CanInteract ||
|
||||||
component.HasCell ||
|
component.HasCell ||
|
||||||
!IoCManager.Resolve<IEntityManager>().HasComponent<PowerCellComponent>(@using) ||
|
!EntityManager.HasComponent<PowerCellComponent>(@using) ||
|
||||||
!_actionBlockerSystem.CanDrop(args.User))
|
!_actionBlockerSystem.CanDrop(args.User))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(@using).EntityName;
|
verb.Text = EntityManager.GetComponent<MetaDataComponent>(@using).EntityName;
|
||||||
verb.Category = VerbCategory.Insert;
|
verb.Category = VerbCategory.Insert;
|
||||||
verb.Act = () => component.InsertCell(@using);
|
verb.Act = () => component.InsertCell(@using);
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ namespace Content.Server.Projectiles
|
|||||||
|
|
||||||
var otherEntity = args.OtherFixture.Body.Owner;
|
var otherEntity = args.OtherFixture.Body.Owner;
|
||||||
|
|
||||||
var coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.OtherFixture.Body.Owner).Coordinates;
|
var coordinates = EntityManager.GetComponent<TransformComponent>(args.OtherFixture.Body.Owner).Coordinates;
|
||||||
var playerFilter = Filter.Pvs(coordinates);
|
var playerFilter = Filter.Pvs(coordinates);
|
||||||
|
|
||||||
if (!EntityManager.GetComponent<MetaDataComponent>(otherEntity).EntityDeleted && component.SoundHitSpecies != null &&
|
if (!EntityManager.GetComponent<MetaDataComponent>(otherEntity).EntityDeleted && component.SoundHitSpecies != null &&
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(otherEntity))
|
EntityManager.HasComponent<SharedBodyComponent>(otherEntity))
|
||||||
{
|
{
|
||||||
SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
|
SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ namespace Content.Server.Projectiles
|
|||||||
|
|
||||||
if (component.TimeLeft <= 0)
|
if (component.TimeLeft <= 0)
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
EntityManager.DeleteEntity(component.Owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,11 +128,11 @@ namespace Content.Server.RCD.Systems
|
|||||||
// thus we early return to avoid the tile set code.
|
// thus we early return to avoid the tile set code.
|
||||||
case RcdMode.Walls:
|
case RcdMode.Walls:
|
||||||
var ent = EntityManager.SpawnEntity("WallSolid", mapGrid.GridTileToLocal(snapPos));
|
var ent = EntityManager.SpawnEntity("WallSolid", mapGrid.GridTileToLocal(snapPos));
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent).LocalRotation = Angle.Zero; // Walls always need to point south.
|
EntityManager.GetComponent<TransformComponent>(ent).LocalRotation = Angle.Zero; // Walls always need to point south.
|
||||||
break;
|
break;
|
||||||
case RcdMode.Airlock:
|
case RcdMode.Airlock:
|
||||||
var airlock = EntityManager.SpawnEntity("Airlock", mapGrid.GridTileToLocal(snapPos));
|
var airlock = EntityManager.SpawnEntity("Airlock", mapGrid.GridTileToLocal(snapPos));
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airlock).LocalRotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(rcd.Owner).LocalRotation; //Now apply icon smoothing.
|
EntityManager.GetComponent<TransformComponent>(airlock).LocalRotation = EntityManager.GetComponent<TransformComponent>(rcd.Owner).LocalRotation; //Now apply icon smoothing.
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ namespace Content.Server.Recycling
|
|||||||
// TODO: Prevent collision with recycled items
|
// TODO: Prevent collision with recycled items
|
||||||
|
|
||||||
// Can only recycle things that are recyclable... And also check the safety of the thing to recycle.
|
// Can only recycle things that are recyclable... And also check the safety of the thing to recycle.
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out RecyclableComponent? recyclable) || !recyclable.Safe && component.Safe) return;
|
if (!EntityManager.TryGetComponent(entity, out RecyclableComponent? recyclable) || !recyclable.Safe && component.Safe) return;
|
||||||
|
|
||||||
// Mobs are a special case!
|
// Mobs are a special case!
|
||||||
if (CanGib(component, entity))
|
if (CanGib(component, entity))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<SharedBodyComponent>(entity).Gib(true);
|
EntityManager.GetComponent<SharedBodyComponent>(entity).Gib(true);
|
||||||
Bloodstain(component);
|
Bloodstain(component);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -42,13 +42,13 @@ namespace Content.Server.Recycling
|
|||||||
private bool CanGib(RecyclerComponent component, EntityUid entity)
|
private bool CanGib(RecyclerComponent component, EntityUid entity)
|
||||||
{
|
{
|
||||||
// We suppose this entity has a Recyclable component.
|
// We suppose this entity has a Recyclable component.
|
||||||
return IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity) && !component.Safe &&
|
return EntityManager.HasComponent<SharedBodyComponent>(entity) && !component.Safe &&
|
||||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) && receiver.Powered;
|
EntityManager.TryGetComponent(component.Owner, out ApcPowerReceiverComponent? receiver) && receiver.Powered;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Bloodstain(RecyclerComponent component)
|
public void Bloodstain(RecyclerComponent component)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
appearance.SetData(RecyclerVisuals.Bloody, true);
|
appearance.SetData(RecyclerVisuals.Bloody, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Content.Server.Repairable
|
|||||||
public async void Repair(EntityUid uid, RepairableComponent component, InteractUsingEvent args)
|
public async void Repair(EntityUid uid, RepairableComponent component, InteractUsingEvent args)
|
||||||
{
|
{
|
||||||
// Only try repair the target if it is damaged
|
// Only try repair the target if it is damaged
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out DamageableComponent? damageable) || damageable.TotalDamage == 0)
|
if (!EntityManager.TryGetComponent(component.Owner, out DamageableComponent? damageable) || damageable.TotalDamage == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Can the tool actually repair this, does it have enough fuel?
|
// Can the tool actually repair this, does it have enough fuel?
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ namespace Content.Server.Rotatable
|
|||||||
|
|
||||||
// Check if the object is anchored, and whether we are still allowed to rotate it.
|
// Check if the object is anchored, and whether we are still allowed to rotate it.
|
||||||
if (!component.RotateWhileAnchored &&
|
if (!component.RotateWhileAnchored &&
|
||||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
EntityManager.TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
||||||
physics.BodyType == BodyType.Static)
|
physics.BodyType == BodyType.Static)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Verb resetRotation = new();
|
Verb resetRotation = new();
|
||||||
resetRotation.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation = Angle.Zero;
|
resetRotation.Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation = Angle.Zero;
|
||||||
resetRotation.Category = VerbCategory.Rotate;
|
resetRotation.Category = VerbCategory.Rotate;
|
||||||
resetRotation.IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png";
|
resetRotation.IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png";
|
||||||
resetRotation.Text = "Reset";
|
resetRotation.Text = "Reset";
|
||||||
@@ -54,7 +54,7 @@ namespace Content.Server.Rotatable
|
|||||||
|
|
||||||
// rotate clockwise
|
// rotate clockwise
|
||||||
Verb rotateCW = new();
|
Verb rotateCW = new();
|
||||||
rotateCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(-90);
|
rotateCW.Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(-90);
|
||||||
rotateCW.Category = VerbCategory.Rotate;
|
rotateCW.Category = VerbCategory.Rotate;
|
||||||
rotateCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png";
|
rotateCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png";
|
||||||
rotateCW.Priority = -1;
|
rotateCW.Priority = -1;
|
||||||
@@ -63,7 +63,7 @@ namespace Content.Server.Rotatable
|
|||||||
|
|
||||||
// rotate counter-clockwise
|
// rotate counter-clockwise
|
||||||
Verb rotateCCW = new();
|
Verb rotateCCW = new();
|
||||||
rotateCCW.Act = () => IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(90);
|
rotateCCW.Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation += Angle.FromDegrees(90);
|
||||||
rotateCCW.Category = VerbCategory.Rotate;
|
rotateCCW.Category = VerbCategory.Rotate;
|
||||||
rotateCCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png";
|
rotateCCW.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png";
|
||||||
rotateCCW.Priority = 0;
|
rotateCCW.Priority = 0;
|
||||||
@@ -76,19 +76,19 @@ namespace Content.Server.Rotatable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static void TryFlip(FlippableComponent component, EntityUid user)
|
public static void TryFlip(FlippableComponent component, EntityUid user)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
if (EntityManager.TryGetComponent(component.Owner, out IPhysBody? physics) &&
|
||||||
physics.BodyType == BodyType.Static)
|
physics.BodyType == BodyType.Static)
|
||||||
{
|
{
|
||||||
component.Owner.PopupMessage(user, Loc.GetString("flippable-component-try-flip-is-stuck"));
|
component.Owner.PopupMessage(user, Loc.GetString("flippable-component-try-flip-is-stuck"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var oldTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner);
|
var oldTransform = EntityManager.GetComponent<TransformComponent>(component.Owner);
|
||||||
var entity = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.MirrorEntity, oldTransform.Coordinates);
|
var entity = EntityManager.SpawnEntity(component.MirrorEntity, oldTransform.Coordinates);
|
||||||
var newTransform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity);
|
var newTransform = EntityManager.GetComponent<TransformComponent>(entity);
|
||||||
newTransform.LocalRotation = oldTransform.LocalRotation;
|
newTransform.LocalRotation = oldTransform.LocalRotation;
|
||||||
newTransform.Anchored = false;
|
newTransform.Anchored = false;
|
||||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
EntityManager.DeleteEntity(component.Owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Content.Server.Security.Systems
|
|||||||
|
|
||||||
private void OnStartup(EntityUid uid, DeployableBarrierComponent component, ComponentStartup args)
|
private void OnStartup(EntityUid uid, DeployableBarrierComponent component, ComponentStartup args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out LockComponent? lockComponent))
|
if (!EntityManager.TryGetComponent(component.Owner, out LockComponent? lockComponent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ToggleBarrierDeploy(component, lockComponent.Locked);
|
ToggleBarrierDeploy(component, lockComponent.Locked);
|
||||||
@@ -32,15 +32,15 @@ namespace Content.Server.Security.Systems
|
|||||||
|
|
||||||
private void ToggleBarrierDeploy(DeployableBarrierComponent component, bool isDeployed)
|
private void ToggleBarrierDeploy(DeployableBarrierComponent component, bool isDeployed)
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored = isDeployed;
|
EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored = isDeployed;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out AppearanceComponent? appearanceComponent))
|
if (!EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearanceComponent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var state = isDeployed ? DeployableBarrierState.Deployed : DeployableBarrierState.Idle;
|
var state = isDeployed ? DeployableBarrierState.Deployed : DeployableBarrierState.Idle;
|
||||||
appearanceComponent.SetData(DeployableBarrierVisuals.State, state);
|
appearanceComponent.SetData(DeployableBarrierVisuals.State, state);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PointLightComponent? light))
|
if (EntityManager.TryGetComponent(component.Owner, out PointLightComponent? light))
|
||||||
light.Enabled = isDeployed;
|
light.Enabled = isDeployed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
public void AddPilot(EntityUid entity, ShuttleConsoleComponent component)
|
public void AddPilot(EntityUid entity, ShuttleConsoleComponent component)
|
||||||
{
|
{
|
||||||
if (!_blocker.CanInteract(entity) ||
|
if (!_blocker.CanInteract(entity) ||
|
||||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out PilotComponent? pilotComponent) ||
|
!EntityManager.TryGetComponent(entity, out PilotComponent? pilotComponent) ||
|
||||||
component.SubscribedPilots.Contains(pilotComponent))
|
component.SubscribedPilots.Contains(pilotComponent))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -141,7 +141,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
component.SubscribedPilots.Add(pilotComponent);
|
component.SubscribedPilots.Add(pilotComponent);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out ServerAlertsComponent? alertsComponent))
|
if (EntityManager.TryGetComponent(entity, out ServerAlertsComponent? alertsComponent))
|
||||||
{
|
{
|
||||||
alertsComponent.ShowAlert(AlertType.PilotingShuttle);
|
alertsComponent.ShowAlert(AlertType.PilotingShuttle);
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
if (!helmsman.SubscribedPilots.Remove(pilotComponent)) return;
|
if (!helmsman.SubscribedPilots.Remove(pilotComponent)) return;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(pilotComponent.Owner, out ServerAlertsComponent? alertsComponent))
|
if (EntityManager.TryGetComponent(pilotComponent.Owner, out ServerAlertsComponent? alertsComponent))
|
||||||
{
|
{
|
||||||
alertsComponent.ClearAlert(AlertType.PilotingShuttle);
|
alertsComponent.ClearAlert(AlertType.PilotingShuttle);
|
||||||
}
|
}
|
||||||
@@ -176,7 +176,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
public void RemovePilot(EntityUid entity)
|
public void RemovePilot(EntityUid entity)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out PilotComponent? pilotComponent)) return;
|
if (!EntityManager.TryGetComponent(entity, out PilotComponent? pilotComponent)) return;
|
||||||
|
|
||||||
RemovePilot(pilotComponent);
|
RemovePilot(pilotComponent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(component.Owner))
|
if (!EntityManager.HasComponent<IMapGridComponent>(component.Owner))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
|
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
|
|
||||||
public void Toggle(ShuttleComponent component)
|
public void Toggle(ShuttleComponent component)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent)) return;
|
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent)) return;
|
||||||
|
|
||||||
component.Enabled = !component.Enabled;
|
component.Enabled = !component.Enabled;
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
|||||||
// None of the below is necessary for any cleanup if we're just deleting.
|
// None of the below is necessary for any cleanup if we're just deleting.
|
||||||
if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating) return;
|
if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating) return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
|
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
|
|
||||||
private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, StartCollideEvent args)
|
private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, StartCollideEvent args)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SingularityGeneratorComponent?>(args.OtherFixture.Body.Owner, out var singularityGeneratorComponent))
|
if (EntityManager.TryGetComponent<SingularityGeneratorComponent?>(args.OtherFixture.Body.Owner, out var singularityGeneratorComponent))
|
||||||
{
|
{
|
||||||
singularityGeneratorComponent.Power += component.State switch
|
singularityGeneratorComponent.Power += component.State switch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out PhysicsComponent? phys) && phys.BodyType == BodyType.Static)
|
if (EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? phys) && phys.BodyType == BodyType.Static)
|
||||||
{
|
{
|
||||||
if (!component.IsOn)
|
if (!component.IsOn)
|
||||||
{
|
{
|
||||||
@@ -166,9 +166,9 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
|
|
||||||
private void Fire(EmitterComponent component)
|
private void Fire(EmitterComponent component)
|
||||||
{
|
{
|
||||||
var projectile = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.BoltType, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates);
|
var projectile = EntityManager.SpawnEntity(component.BoltType, EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates);
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<PhysicsComponent?>(projectile, out var physicsComponent))
|
if (!EntityManager.TryGetComponent<PhysicsComponent?>(projectile, out var physicsComponent))
|
||||||
{
|
{
|
||||||
Logger.Error("Emitter tried firing a bolt, but it was spawned without a PhysicsComponent");
|
Logger.Error("Emitter tried firing a bolt, but it was spawned without a PhysicsComponent");
|
||||||
return;
|
return;
|
||||||
@@ -176,7 +176,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
|
|
||||||
physicsComponent.BodyStatus = BodyStatus.InAir;
|
physicsComponent.BodyStatus = BodyStatus.InAir;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ProjectileComponent?>(projectile, out var projectileComponent))
|
if (!EntityManager.TryGetComponent<ProjectileComponent?>(projectile, out var projectileComponent))
|
||||||
{
|
{
|
||||||
Logger.Error("Emitter tried firing a bolt, but it was spawned without a ProjectileComponent");
|
Logger.Error("Emitter tried firing a bolt, but it was spawned without a ProjectileComponent");
|
||||||
return;
|
return;
|
||||||
@@ -185,11 +185,11 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
projectileComponent.IgnoreEntity(component.Owner);
|
projectileComponent.IgnoreEntity(component.Owner);
|
||||||
|
|
||||||
physicsComponent
|
physicsComponent
|
||||||
.LinearVelocity = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).WorldRotation.ToWorldVec() * 20f;
|
.LinearVelocity = EntityManager.GetComponent<TransformComponent>(component.Owner).WorldRotation.ToWorldVec() * 20f;
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(projectile).WorldRotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).WorldRotation;
|
EntityManager.GetComponent<TransformComponent>(projectile).WorldRotation = EntityManager.GetComponent<TransformComponent>(component.Owner).WorldRotation;
|
||||||
|
|
||||||
// TODO: Move to projectile's code.
|
// TODO: Move to projectile's code.
|
||||||
Timer.Spawn(3000, () => IoCManager.Resolve<IEntityManager>().DeleteEntity(projectile));
|
Timer.Spawn(3000, () => EntityManager.DeleteEntity(projectile));
|
||||||
|
|
||||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner,
|
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner,
|
||||||
AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance));
|
AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance));
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
{
|
{
|
||||||
if (component.BeingDeletedByAnotherSingularity) return;
|
if (component.BeingDeletedByAnotherSingularity) return;
|
||||||
|
|
||||||
var worldPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).WorldPosition;
|
var worldPos = EntityManager.GetComponent<TransformComponent>(component.Owner).WorldPosition;
|
||||||
DestroyEntities(component, worldPos);
|
DestroyEntities(component, worldPos);
|
||||||
DestroyTiles(component, worldPos);
|
DestroyTiles(component, worldPos);
|
||||||
PullEntities(component, worldPos);
|
PullEntities(component, worldPos);
|
||||||
@@ -102,10 +102,10 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
private bool CanDestroy(SharedSingularityComponent component, EntityUid entity)
|
private bool CanDestroy(SharedSingularityComponent component, EntityUid entity)
|
||||||
{
|
{
|
||||||
return entity == component.Owner ||
|
return entity == component.Owner ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(entity) ||
|
EntityManager.HasComponent<IMapGridComponent>(entity) ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<GhostComponent>(entity) ||
|
EntityManager.HasComponent<GhostComponent>(entity) ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<ContainmentFieldComponent>(entity) ||
|
EntityManager.HasComponent<ContainmentFieldComponent>(entity) ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<ContainmentFieldGeneratorComponent>(entity);
|
EntityManager.HasComponent<ContainmentFieldGeneratorComponent>(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDestroy(ServerSingularityComponent component, EntityUid entity)
|
private void HandleDestroy(ServerSingularityComponent component, EntityUid entity)
|
||||||
@@ -114,7 +114,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
if (CanDestroy(component, entity)) return;
|
if (CanDestroy(component, entity)) return;
|
||||||
|
|
||||||
// Singularity priority management / etc.
|
// Singularity priority management / etc.
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(entity, out var otherSingulo))
|
if (EntityManager.TryGetComponent<ServerSingularityComponent?>(entity, out var otherSingulo))
|
||||||
{
|
{
|
||||||
// MERGE
|
// MERGE
|
||||||
if (!otherSingulo.BeingDeletedByAnotherSingularity)
|
if (!otherSingulo.BeingDeletedByAnotherSingularity)
|
||||||
@@ -125,9 +125,9 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
otherSingulo.BeingDeletedByAnotherSingularity = true;
|
otherSingulo.BeingDeletedByAnotherSingularity = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity);
|
EntityManager.QueueDeleteEntity(entity);
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SinguloFoodComponent?>(entity, out var singuloFood))
|
if (EntityManager.TryGetComponent<SinguloFoodComponent?>(entity, out var singuloFood))
|
||||||
component.Energy += singuloFood.Energy;
|
component.Energy += singuloFood.Energy;
|
||||||
else
|
else
|
||||||
component.Energy++;
|
component.Energy++;
|
||||||
@@ -141,7 +141,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
// The reason we don't /just/ use collision is because we'll be deleting stuff that may not necessarily have physics (e.g. carpets).
|
// The reason we don't /just/ use collision is because we'll be deleting stuff that may not necessarily have physics (e.g. carpets).
|
||||||
var destroyRange = DestroyTileRange(component);
|
var destroyRange = DestroyTileRange(component);
|
||||||
|
|
||||||
foreach (var entity in _lookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).MapID, worldPos, destroyRange))
|
foreach (var entity in _lookup.GetEntitiesInRange(EntityManager.GetComponent<TransformComponent>(component.Owner).MapID, worldPos, destroyRange))
|
||||||
{
|
{
|
||||||
HandleDestroy(component, entity);
|
HandleDestroy(component, entity);
|
||||||
}
|
}
|
||||||
@@ -149,9 +149,9 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
|
|
||||||
private bool CanPull(EntityUid entity)
|
private bool CanPull(EntityUid entity)
|
||||||
{
|
{
|
||||||
return !(IoCManager.Resolve<IEntityManager>().HasComponent<GhostComponent>(entity) ||
|
return !(EntityManager.HasComponent<GhostComponent>(entity) ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(entity) ||
|
EntityManager.HasComponent<IMapGridComponent>(entity) ||
|
||||||
IoCManager.Resolve<IEntityManager>().HasComponent<MapComponent>(entity) ||
|
EntityManager.HasComponent<MapComponent>(entity) ||
|
||||||
entity.IsInContainer());
|
entity.IsInContainer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,16 +162,16 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
var pullRange = PullRange(component);
|
var pullRange = PullRange(component);
|
||||||
var destroyRange = DestroyTileRange(component);
|
var destroyRange = DestroyTileRange(component);
|
||||||
|
|
||||||
foreach (var entity in _lookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).MapID, worldPos, pullRange))
|
foreach (var entity in _lookup.GetEntitiesInRange(EntityManager.GetComponent<TransformComponent>(component.Owner).MapID, worldPos, pullRange))
|
||||||
{
|
{
|
||||||
// I tried having it so level 6 can de-anchor. BAD IDEA, MASSIVE LAG.
|
// I tried having it so level 6 can de-anchor. BAD IDEA, MASSIVE LAG.
|
||||||
if (entity == component.Owner ||
|
if (entity == component.Owner ||
|
||||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent<PhysicsComponent?>(entity, out var collidableComponent) ||
|
!EntityManager.TryGetComponent<PhysicsComponent?>(entity, out var collidableComponent) ||
|
||||||
collidableComponent.BodyType == BodyType.Static) continue;
|
collidableComponent.BodyType == BodyType.Static) continue;
|
||||||
|
|
||||||
if (!CanPull(entity)) continue;
|
if (!CanPull(entity)) continue;
|
||||||
|
|
||||||
var vec = worldPos - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).WorldPosition;
|
var vec = worldPos - EntityManager.GetComponent<TransformComponent>(entity).WorldPosition;
|
||||||
|
|
||||||
if (vec.Length < destroyRange - 0.01f) continue;
|
if (vec.Length < destroyRange - 0.01f) continue;
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||||||
var circle = new Circle(worldPos, radius);
|
var circle = new Circle(worldPos, radius);
|
||||||
var box = new Box2(worldPos - radius, worldPos + radius);
|
var box = new Box2(worldPos - radius, worldPos + radius);
|
||||||
|
|
||||||
foreach (var grid in _mapManager.FindGridsIntersecting(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).MapID, box))
|
foreach (var grid in _mapManager.FindGridsIntersecting(EntityManager.GetComponent<TransformComponent>(component.Owner).MapID, box))
|
||||||
{
|
{
|
||||||
foreach (var tile in grid.GetTilesIntersecting(circle))
|
foreach (var tile in grid.GetTilesIntersecting(circle))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Server.Stack
|
|||||||
// Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked...
|
// Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked...
|
||||||
var prototype = _prototypeManager.TryIndex<StackPrototype>(stack.StackTypeId, out var stackType)
|
var prototype = _prototypeManager.TryIndex<StackPrototype>(stack.StackTypeId, out var stackType)
|
||||||
? stackType.Spawn
|
? stackType.Spawn
|
||||||
: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(stack.Owner).EntityPrototype?.ID;
|
: EntityManager.GetComponent<MetaDataComponent>(stack.Owner).EntityPrototype?.ID;
|
||||||
|
|
||||||
// Try to remove the amount of things we want to split from the original stack...
|
// Try to remove the amount of things we want to split from the original stack...
|
||||||
if (!Use(uid, amount, stack))
|
if (!Use(uid, amount, stack))
|
||||||
@@ -86,7 +86,7 @@ namespace Content.Server.Stack
|
|||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<StackComponent?>(args.Used, out var otherStack))
|
if (!EntityManager.TryGetComponent<StackComponent?>(args.Used, out var otherStack))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!otherStack.StackTypeId.Equals(stack.StackTypeId))
|
if (!otherStack.StackTypeId.Equals(stack.StackTypeId))
|
||||||
@@ -100,7 +100,7 @@ namespace Content.Server.Stack
|
|||||||
|
|
||||||
if (!popupPos.IsValid(EntityManager))
|
if (!popupPos.IsValid(EntityManager))
|
||||||
{
|
{
|
||||||
popupPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).Coordinates;
|
popupPos = EntityManager.GetComponent<TransformComponent>(args.User).Coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
var filter = Filter.Entities(args.User);
|
var filter = Filter.Entities(args.User);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
{
|
{
|
||||||
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(msg.Container.Owner, out ServerStorageComponent? component)
|
if (!EntityManager.TryGetComponent(msg.Container.Owner, out ServerStorageComponent? component)
|
||||||
|| component.StoredEntities == null)
|
|| component.StoredEntities == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
ItemMapperComponent itemMapper,
|
ItemMapperComponent itemMapper,
|
||||||
out IReadOnlyList<string> showLayers)
|
out IReadOnlyList<string> showLayers)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(msg.Container.Owner, out ServerStorageComponent? component))
|
if (EntityManager.TryGetComponent(msg.Container.Owner, out ServerStorageComponent? component))
|
||||||
{
|
{
|
||||||
var containedLayers = component.StoredEntities ?? new List<EntityUid>();
|
var containedLayers = component.StoredEntities ?? new List<EntityUid>();
|
||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Get the session for the user
|
// Get the session for the user
|
||||||
var session = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ActorComponent>(args.User)?.PlayerSession;
|
var session = EntityManager.GetComponentOrNull<ActorComponent>(args.User)?.PlayerSession;
|
||||||
if (session == null)
|
if (session == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
{
|
{
|
||||||
var oldParentEntity = message.Container.Owner;
|
var oldParentEntity = message.Container.Owner;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(oldParentEntity, out ServerStorageComponent? storageComp))
|
if (EntityManager.TryGetComponent(oldParentEntity, out ServerStorageComponent? storageComp))
|
||||||
{
|
{
|
||||||
storageComp.HandleEntityMaybeRemoved(message);
|
storageComp.HandleEntityMaybeRemoved(message);
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
{
|
{
|
||||||
var oldParentEntity = message.Container.Owner;
|
var oldParentEntity = message.Container.Owner;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(oldParentEntity, out ServerStorageComponent? storageComp))
|
if (EntityManager.TryGetComponent(oldParentEntity, out ServerStorageComponent? storageComp))
|
||||||
{
|
{
|
||||||
storageComp.HandleEntityMaybeInserted(message);
|
storageComp.HandleEntityMaybeInserted(message);
|
||||||
}
|
}
|
||||||
@@ -144,19 +144,19 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
if (_sessionCache.Count == 0)
|
if (_sessionCache.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var storagePos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(storageComp.Owner).WorldPosition;
|
var storagePos = EntityManager.GetComponent<TransformComponent>(storageComp.Owner).WorldPosition;
|
||||||
var storageMap = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(storageComp.Owner).MapID;
|
var storageMap = EntityManager.GetComponent<TransformComponent>(storageComp.Owner).MapID;
|
||||||
|
|
||||||
foreach (var session in _sessionCache)
|
foreach (var session in _sessionCache)
|
||||||
{
|
{
|
||||||
// The component manages the set of sessions, so this invalid session should be removed soon.
|
// The component manages the set of sessions, so this invalid session should be removed soon.
|
||||||
if (session.AttachedEntity is not {} attachedEntity || !IoCManager.Resolve<IEntityManager>().EntityExists(attachedEntity))
|
if (session.AttachedEntity is not {} attachedEntity || !EntityManager.EntityExists(attachedEntity))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (storageMap != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(attachedEntity).MapID)
|
if (storageMap != EntityManager.GetComponent<TransformComponent>(attachedEntity).MapID)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var distanceSquared = (storagePos - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(attachedEntity).WorldPosition).LengthSquared;
|
var distanceSquared = (storagePos - EntityManager.GetComponent<TransformComponent>(attachedEntity).WorldPosition).LengthSquared;
|
||||||
if (distanceSquared > SharedInteractionSystem.InteractionRangeSquared)
|
if (distanceSquared > SharedInteractionSystem.InteractionRangeSquared)
|
||||||
{
|
{
|
||||||
storageComp.UnsubscribeSession(session);
|
storageComp.UnsubscribeSession(session);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Content.Server.Strip
|
|||||||
if (args.Hands == null || !args.CanAccess || !args.CanInteract || args.Target == args.User)
|
if (args.Hands == null || !args.CanAccess || !args.CanInteract || args.Target == args.User)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ namespace Content.Server.Stunnable
|
|||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
// TODO: Use PopupSystem
|
// TODO: Use PopupSystem
|
||||||
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source).EntityName), ("target", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName)));
|
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name: EntityManager.GetComponent<MetaDataComponent>(source).EntityName), ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||||
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target).EntityName)));
|
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,12 +175,12 @@ namespace Content.Server.Stunnable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite) ||
|
if (!EntityManager.TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite) ||
|
||||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent<ItemComponent?>(comp.Owner, out var item))
|
!EntityManager.TryGetComponent<ItemComponent?>(comp.Owner, out var item))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var playerFilter = Filter.Pvs(comp.Owner);
|
var playerFilter = Filter.Pvs(comp.Owner);
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<PowerCellSlotComponent?>(comp.Owner, out var slot))
|
if (!EntityManager.TryGetComponent<PowerCellSlotComponent?>(comp.Owner, out var slot))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (slot.Cell == null)
|
if (slot.Cell == null)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace Content.Server.Tabletop
|
|||||||
if (session.Players.ContainsKey(player))
|
if (session.Players.ContainsKey(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(IoCManager.Resolve<IEntityManager>().TryGetComponent<TabletopGamerComponent?>(attachedEntity, out var gamer))
|
if(EntityManager.TryGetComponent<TabletopGamerComponent?>(attachedEntity, out var gamer))
|
||||||
CloseSessionFor(player, gamer.Tabletop, false);
|
CloseSessionFor(player, gamer.Tabletop, false);
|
||||||
|
|
||||||
// Set the entity as an absolute GAMER.
|
// Set the entity as an absolute GAMER.
|
||||||
@@ -111,13 +111,13 @@ namespace Content.Server.Tabletop
|
|||||||
if (!session.Players.TryGetValue(player, out var data))
|
if (!session.Players.TryGetValue(player, out var data))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(removeGamerComponent && player.AttachedEntity is {} attachedEntity && IoCManager.Resolve<IEntityManager>().TryGetComponent(attachedEntity, out TabletopGamerComponent? gamer))
|
if(removeGamerComponent && player.AttachedEntity is {} attachedEntity && EntityManager.TryGetComponent(attachedEntity, out TabletopGamerComponent? gamer))
|
||||||
{
|
{
|
||||||
// We invalidate this to prevent an infinite feedback from removing the component.
|
// We invalidate this to prevent an infinite feedback from removing the component.
|
||||||
gamer.Tabletop = EntityUid.Invalid;
|
gamer.Tabletop = EntityUid.Invalid;
|
||||||
|
|
||||||
// You stop being a gamer.......
|
// You stop being a gamer.......
|
||||||
IoCManager.Resolve<IEntityManager>().RemoveComponent<TabletopGamerComponent>(attachedEntity);
|
EntityManager.RemoveComponent<TabletopGamerComponent>(attachedEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
session.Players.Remove(player);
|
session.Players.Remove(player);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Content.Server.Tabletop
|
|||||||
if (!args.CanAccess || !args.CanInteract)
|
if (!args.CanAccess || !args.CanInteract)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ActorComponent?>(args.User, out var actor))
|
if (!EntityManager.TryGetComponent<ActorComponent?>(args.User, out var actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
@@ -97,9 +97,9 @@ namespace Content.Server.Tabletop
|
|||||||
if (!EntityManager.EntityExists(gamer.Tabletop))
|
if (!EntityManager.EntityExists(gamer.Tabletop))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(gamer.Owner, out ActorComponent? actor))
|
if (!EntityManager.TryGetComponent(gamer.Owner, out ActorComponent? actor))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().RemoveComponent<TabletopGamerComponent>(gamer.Owner);
|
EntityManager.RemoveComponent<TabletopGamerComponent>(gamer.Owner);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace Content.Server.UserInterface
|
|||||||
|
|
||||||
private bool InteractUI(EntityUid user, ActivatableUIComponent aui)
|
private bool InteractUI(EntityUid user, ActivatableUIComponent aui)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out ActorComponent? actor)) return false;
|
if (!EntityManager.TryGetComponent(user, out ActorComponent? actor)) return false;
|
||||||
|
|
||||||
if (aui.AdminOnly && !_adminManager.IsAdmin(actor.PlayerSession)) return false;
|
if (aui.AdminOnly && !_adminManager.IsAdmin(actor.PlayerSession)) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ namespace Content.Server.Weapon.Melee
|
|||||||
if (curTime < comp.CooldownEnd || !args.Target.IsValid())
|
if (curTime < comp.CooldownEnd || !args.Target.IsValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var location = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).Coordinates;
|
var location = EntityManager.GetComponent<TransformComponent>(args.User).Coordinates;
|
||||||
var diff = args.ClickLocation.ToMapPos(IoCManager.Resolve<IEntityManager>()) - location.ToMapPos(IoCManager.Resolve<IEntityManager>());
|
var diff = args.ClickLocation.ToMapPos(EntityManager) - location.ToMapPos(EntityManager);
|
||||||
var angle = Angle.FromWorldVec(diff);
|
var angle = Angle.FromWorldVec(diff);
|
||||||
|
|
||||||
if (args.Target is {Valid: true} target)
|
if (args.Target is {Valid: true} target)
|
||||||
@@ -132,12 +132,12 @@ namespace Content.Server.Weapon.Melee
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var location = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).Coordinates;
|
var location = EntityManager.GetComponent<TransformComponent>(args.User).Coordinates;
|
||||||
var diff = args.ClickLocation.ToMapPos(IoCManager.Resolve<IEntityManager>()) - location.ToMapPos(IoCManager.Resolve<IEntityManager>());
|
var diff = args.ClickLocation.ToMapPos(EntityManager) - location.ToMapPos(EntityManager);
|
||||||
var angle = Angle.FromWorldVec(diff);
|
var angle = Angle.FromWorldVec(diff);
|
||||||
|
|
||||||
// This should really be improved. GetEntitiesInArc uses pos instead of bounding boxes.
|
// This should really be improved. GetEntitiesInArc uses pos instead of bounding boxes.
|
||||||
var entities = ArcRayCast(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).WorldPosition, angle, comp.ArcWidth, comp.Range, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner).MapID, args.User);
|
var entities = ArcRayCast(EntityManager.GetComponent<TransformComponent>(args.User).WorldPosition, angle, comp.ArcWidth, comp.Range, EntityManager.GetComponent<TransformComponent>(owner).MapID, args.User);
|
||||||
|
|
||||||
var hitEntities = new List<EntityUid>();
|
var hitEntities = new List<EntityUid>();
|
||||||
foreach (var entity in entities)
|
foreach (var entity in entities)
|
||||||
@@ -160,11 +160,11 @@ namespace Content.Server.Weapon.Melee
|
|||||||
{
|
{
|
||||||
if (entities.Count != 0)
|
if (entities.Count != 0)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entities.First()).Coordinates);
|
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), EntityManager.GetComponent<TransformComponent>(entities.First()).Coordinates);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SoundSystem.Play(Filter.Pvs(owner), comp.MissSound.GetSound(), IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).Coordinates);
|
SoundSystem.Play(Filter.Pvs(owner), comp.MissSound.GetSound(), EntityManager.GetComponent<TransformComponent>(args.User).Coordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var entity in hitEntities)
|
foreach (var entity in hitEntities)
|
||||||
@@ -211,8 +211,8 @@ namespace Content.Server.Weapon.Melee
|
|||||||
if (!args.Target.HasValue)
|
if (!args.Target.HasValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var location = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).Coordinates;
|
var location = EntityManager.GetComponent<TransformComponent>(args.User).Coordinates;
|
||||||
var diff = args.ClickLocation.ToMapPos(IoCManager.Resolve<IEntityManager>()) - location.ToMapPos(IoCManager.Resolve<IEntityManager>());
|
var diff = args.ClickLocation.ToMapPos(EntityManager) - location.ToMapPos(EntityManager);
|
||||||
var angle = Angle.FromWorldVec(diff);
|
var angle = Angle.FromWorldVec(diff);
|
||||||
|
|
||||||
var hitEvent = new MeleeInteractEvent(args.Target.Value, args.User);
|
var hitEvent = new MeleeInteractEvent(args.Target.Value, args.User);
|
||||||
@@ -260,10 +260,10 @@ namespace Content.Server.Weapon.Melee
|
|||||||
var hitBloodstreams = new List<BloodstreamComponent>();
|
var hitBloodstreams = new List<BloodstreamComponent>();
|
||||||
foreach (var entity in args.HitEntities)
|
foreach (var entity in args.HitEntities)
|
||||||
{
|
{
|
||||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(entity) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted)
|
if ((!EntityManager.EntityExists(entity) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(entity).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<BloodstreamComponent?>(entity, out var bloodstream))
|
if (EntityManager.TryGetComponent<BloodstreamComponent?>(entity, out var bloodstream))
|
||||||
hitBloodstreams.Add(bloodstream);
|
hitBloodstreams.Add(bloodstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
if (slot.HasItem || string.IsNullOrEmpty(slot.StartingItem))
|
if (slot.HasItem || string.IsNullOrEmpty(slot.StartingItem))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var item = EntityManager.SpawnEntity(slot.StartingItem, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(itemSlots.Owner).Coordinates);
|
var item = EntityManager.SpawnEntity(slot.StartingItem, EntityManager.GetComponent<TransformComponent>(itemSlots.Owner).Coordinates);
|
||||||
slot.ContainerSlot.Insert(item);
|
slot.ContainerSlot.Insert(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid);
|
var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid);
|
||||||
slot.ContainerSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id);
|
slot.ContainerSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id);
|
||||||
if (itemSlots.Slots.ContainsKey(id))
|
if (itemSlots.Slots.ContainsKey(id))
|
||||||
Logger.Error($"Duplicate item slot key. Entity: {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(itemSlots.Owner).EntityName} ({uid}), key: {id}");
|
Logger.Error($"Duplicate item slot key. Entity: {EntityManager.GetComponent<MetaDataComponent>(itemSlots.Owner).EntityName} ({uid}), key: {id}");
|
||||||
itemSlots.Slots[id] = slot;
|
itemSlots.Slots[id] = slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
|
|
||||||
var verbSubject = slot.Name != string.Empty
|
var verbSubject = slot.Name != string.Empty
|
||||||
? Loc.GetString(slot.Name)
|
? Loc.GetString(slot.Name)
|
||||||
: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(slot.Item!.Value).EntityName ?? string.Empty;
|
: EntityManager.GetComponent<MetaDataComponent>(slot.Item!.Value).EntityName ?? string.Empty;
|
||||||
|
|
||||||
Verb verb = new();
|
Verb verb = new();
|
||||||
verb.Act = () => TryEjectToHands(uid, slot, args.User);
|
verb.Act = () => TryEjectToHands(uid, slot, args.User);
|
||||||
@@ -399,7 +399,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
|
|
||||||
var verbSubject = slot.Name != string.Empty
|
var verbSubject = slot.Name != string.Empty
|
||||||
? Loc.GetString(slot.Name)
|
? Loc.GetString(slot.Name)
|
||||||
: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(slot.Item!.Value).EntityName ?? string.Empty;
|
: EntityManager.GetComponent<MetaDataComponent>(slot.Item!.Value).EntityName ?? string.Empty;
|
||||||
|
|
||||||
Verb takeVerb = new();
|
Verb takeVerb = new();
|
||||||
takeVerb.Act = () => TryEjectToHands(uid, slot, args.User);
|
takeVerb.Act = () => TryEjectToHands(uid, slot, args.User);
|
||||||
@@ -425,7 +425,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
|
|
||||||
var verbSubject = slot.Name != string.Empty
|
var verbSubject = slot.Name != string.Empty
|
||||||
? Loc.GetString(slot.Name)
|
? Loc.GetString(slot.Name)
|
||||||
: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Value).EntityName ?? string.Empty;
|
: EntityManager.GetComponent<MetaDataComponent>(args.Using.Value).EntityName ?? string.Empty;
|
||||||
|
|
||||||
Verb insertVerb = new();
|
Verb insertVerb = new();
|
||||||
insertVerb.Act = () => Insert(uid, slot, args.Using.Value);
|
insertVerb.Act = () => Insert(uid, slot, args.Using.Value);
|
||||||
|
|||||||
@@ -49,21 +49,21 @@ namespace Content.Shared.Disposal
|
|||||||
|
|
||||||
public virtual bool CanInsert(SharedDisposalUnitComponent component, EntityUid entity)
|
public virtual bool CanInsert(SharedDisposalUnitComponent component, EntityUid entity)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO: Probably just need a disposable tag.
|
// TODO: Probably just need a disposable tag.
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedItemComponent? storable) &&
|
if (!EntityManager.TryGetComponent(entity, out SharedItemComponent? storable) &&
|
||||||
!IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity))
|
!EntityManager.HasComponent<SharedBodyComponent>(entity))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IPhysBody? physics) ||
|
if (!EntityManager.TryGetComponent(entity, out IPhysBody? physics) ||
|
||||||
!physics.CanCollide && storable == null)
|
!physics.CanCollide && storable == null)
|
||||||
{
|
{
|
||||||
if (!(IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out MobStateComponent? damageState) && damageState.IsDead()))
|
if (!(EntityManager.TryGetComponent(entity, out MobStateComponent? damageState) && damageState.IsDead()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,24 +64,24 @@ namespace Content.Shared.Examine
|
|||||||
[Pure]
|
[Pure]
|
||||||
public bool CanExamine(EntityUid examiner, EntityUid examined)
|
public bool CanExamine(EntityUid examiner, EntityUid examined)
|
||||||
{
|
{
|
||||||
return CanExamine(examiner, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(examined).MapPosition,
|
return CanExamine(examiner, EntityManager.GetComponent<TransformComponent>(examined).MapPosition,
|
||||||
entity => entity == examiner || entity == examined);
|
entity => entity == examiner || entity == examined);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Pure]
|
[Pure]
|
||||||
public virtual bool CanExamine(EntityUid examiner, MapCoordinates target, Ignored? predicate = null)
|
public virtual bool CanExamine(EntityUid examiner, MapCoordinates target, Ignored? predicate = null)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(examiner, out ExaminerComponent? examinerComponent))
|
if (!EntityManager.TryGetComponent(examiner, out ExaminerComponent? examinerComponent))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!examinerComponent.DoRangeCheck)
|
if (!examinerComponent.DoRangeCheck)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(examiner).MapID != target.MapId)
|
if (EntityManager.GetComponent<TransformComponent>(examiner).MapID != target.MapId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return InRangeUnOccluded(
|
return InRangeUnOccluded(
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(examiner).MapPosition,
|
EntityManager.GetComponent<TransformComponent>(examiner).MapPosition,
|
||||||
target,
|
target,
|
||||||
GetExaminerRange(examiner),
|
GetExaminerRange(examiner),
|
||||||
predicate: predicate,
|
predicate: predicate,
|
||||||
@@ -128,12 +128,12 @@ namespace Content.Shared.Examine
|
|||||||
|
|
||||||
foreach (var result in rayResults)
|
foreach (var result in rayResults)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(result.HitEntity, out OccluderComponent? o))
|
if (!EntityManager.TryGetComponent(result.HitEntity, out OccluderComponent? o))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var bBox = o.BoundingBox.Translated(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(o.Owner).WorldPosition);
|
var bBox = o.BoundingBox.Translated(EntityManager.GetComponent<TransformComponent>(o.Owner).WorldPosition);
|
||||||
|
|
||||||
if (bBox.Contains(origin.Position) || bBox.Contains(other.Position))
|
if (bBox.Contains(origin.Position) || bBox.Contains(other.Position))
|
||||||
{
|
{
|
||||||
@@ -148,54 +148,54 @@ namespace Content.Shared.Examine
|
|||||||
|
|
||||||
public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
|
||||||
var otherPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(other).MapPosition;
|
var otherPos = EntityManager.GetComponent<TransformComponent>(other).MapPosition;
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(EntityUid origin, IComponent other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(EntityUid origin, IComponent other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
|
||||||
var otherPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(other.Owner).MapPosition;
|
var otherPos = EntityManager.GetComponent<TransformComponent>(other.Owner).MapPosition;
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
|
||||||
var otherPos = other.ToMap(IoCManager.Resolve<IEntityManager>());
|
var otherPos = other.ToMap(EntityManager);
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, other, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, other, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(ITargetedInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(ITargetedInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||||
var otherPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Target).MapPosition;
|
var otherPos = EntityManager.GetComponent<TransformComponent>(args.Target).MapPosition;
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(DragDropEvent args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(DragDropEvent args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var originPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.User).MapPosition;
|
var originPos = EntityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||||
var otherPos = args.DropLocation.ToMap(IoCManager.Resolve<IEntityManager>());
|
var otherPos = args.DropLocation.ToMap(EntityManager);
|
||||||
|
|
||||||
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InRangeUnOccluded(AfterInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
public static bool InRangeUnOccluded(AfterInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
|
||||||
{
|
{
|
||||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
var entityManager = EntityManager;
|
||||||
var originPos = entityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
var originPos = entityManager.GetComponent<TransformComponent>(args.User).MapPosition;
|
||||||
var target = args.Target;
|
var target = args.Target;
|
||||||
var otherPos = (target != null ? entityManager.GetComponent<TransformComponent>(target.Value).MapPosition : args.ClickLocation.ToMap(entityManager));
|
var otherPos = (target != null ? entityManager.GetComponent<TransformComponent>(target.Value).MapPosition : args.ClickLocation.ToMap(entityManager));
|
||||||
@@ -215,9 +215,9 @@ namespace Content.Shared.Examine
|
|||||||
var doNewline = false;
|
var doNewline = false;
|
||||||
|
|
||||||
//Add an entity description if one is declared
|
//Add an entity description if one is declared
|
||||||
if (!string.IsNullOrEmpty(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityDescription))
|
if (!string.IsNullOrEmpty(EntityManager.GetComponent<MetaDataComponent>(entity).EntityDescription))
|
||||||
{
|
{
|
||||||
message.AddText(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityDescription);
|
message.AddText(EntityManager.GetComponent<MetaDataComponent>(entity).EntityDescription);
|
||||||
doNewline = true;
|
doNewline = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ namespace Content.Shared.Examine
|
|||||||
RaiseLocalEvent(entity, examinedEvent);
|
RaiseLocalEvent(entity, examinedEvent);
|
||||||
|
|
||||||
//Add component statuses from components that report one
|
//Add component statuses from components that report one
|
||||||
foreach (var examineComponent in IoCManager.Resolve<IEntityManager>().GetComponents<IExamine>(entity))
|
foreach (var examineComponent in EntityManager.GetComponents<IExamine>(entity))
|
||||||
{
|
{
|
||||||
var subMessage = new FormattedMessage();
|
var subMessage = new FormattedMessage();
|
||||||
examineComponent.Examine(subMessage, isInDetailsRange);
|
examineComponent.Examine(subMessage, isInDetailsRange);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Content.Shared.Interaction
|
|||||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||||
public bool TryFaceCoordinates(EntityUid user, Vector2 coordinates)
|
public bool TryFaceCoordinates(EntityUid user, Vector2 coordinates)
|
||||||
{
|
{
|
||||||
var diff = coordinates - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user).MapPosition.Position;
|
var diff = coordinates - EntityManager.GetComponent<TransformComponent>(user).MapPosition.Position;
|
||||||
if (diff.LengthSquared <= 0.01f)
|
if (diff.LengthSquared <= 0.01f)
|
||||||
return true;
|
return true;
|
||||||
var diffAngle = Angle.FromWorldVec(diff);
|
var diffAngle = Angle.FromWorldVec(diff);
|
||||||
@@ -47,12 +47,12 @@ namespace Content.Shared.Interaction
|
|||||||
{
|
{
|
||||||
if (_actionBlockerSystem.CanChangeDirection(user))
|
if (_actionBlockerSystem.CanChangeDirection(user))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user).WorldRotation = diffAngle;
|
EntityManager.GetComponent<TransformComponent>(user).WorldRotation = diffAngle;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(user, out SharedBuckleComponent? buckle) && buckle.Buckled)
|
if (EntityManager.TryGetComponent(user, out SharedBuckleComponent? buckle) && buckle.Buckled)
|
||||||
{
|
{
|
||||||
var suid = buckle.LastEntityBuckledTo;
|
var suid = buckle.LastEntityBuckledTo;
|
||||||
if (suid != null)
|
if (suid != null)
|
||||||
@@ -64,7 +64,7 @@ namespace Content.Shared.Interaction
|
|||||||
// (Since the user being buckled to it holds it down with their weight.)
|
// (Since the user being buckled to it holds it down with their weight.)
|
||||||
// This is logically equivalent to RotateWhileAnchored.
|
// This is logically equivalent to RotateWhileAnchored.
|
||||||
// Barstools and office chairs have independent wheels, while regular chairs don't.
|
// Barstools and office chairs have independent wheels, while regular chairs don't.
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(rotatable.Owner).WorldRotation = diffAngle;
|
EntityManager.GetComponent<TransformComponent>(rotatable.Owner).WorldRotation = diffAngle;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Content.Shared.Movement.EntitySystems
|
|||||||
|
|
||||||
if (otherBody.BodyType != BodyType.Dynamic || !otherFixture.Hard) return;
|
if (otherBody.BodyType != BodyType.Dynamic || !otherFixture.Hard) return;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ourFixture.Body.Owner, out IMobMoverComponent? mobMover) || worldNormal == Vector2.Zero) return;
|
if (!EntityManager.TryGetComponent(ourFixture.Body.Owner, out IMobMoverComponent? mobMover) || worldNormal == Vector2.Zero) return;
|
||||||
|
|
||||||
otherBody.ApplyLinearImpulse(-worldNormal * mobMover.PushStrength * frameTime);
|
otherBody.ApplyLinearImpulse(-worldNormal * mobMover.PushStrength * frameTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ namespace Content.Shared.Movement.EntitySystems
|
|||||||
|
|
||||||
var ent = session?.AttachedEntity;
|
var ent = session?.AttachedEntity;
|
||||||
|
|
||||||
if (ent == null || !IoCManager.Resolve<IEntityManager>().EntityExists(ent.Value))
|
if (ent == null || !EntityManager.EntityExists(ent.Value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ent.Value, out T? comp))
|
if (!EntityManager.TryGetComponent(ent.Value, out T? comp))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
component = comp;
|
component = comp;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Content.Shared.Nutrition.EntitySystems
|
|||||||
|
|
||||||
private void OnCreamPiedHitBy(EntityUid uid, CreamPiedComponent creamPied, ThrowHitByEvent args)
|
private void OnCreamPiedHitBy(EntityUid uid, CreamPiedComponent creamPied, ThrowHitByEvent args)
|
||||||
{
|
{
|
||||||
if (!IoCManager.Resolve<IEntityManager>().EntityExists(args.Thrown) || !IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Thrown, out CreamPieComponent? creamPie)) return;
|
if (!EntityManager.EntityExists(args.Thrown) || !EntityManager.TryGetComponent(args.Thrown, out CreamPieComponent? creamPie)) return;
|
||||||
|
|
||||||
SetCreamPied(uid, creamPied, true);
|
SetCreamPied(uid, creamPied, true);
|
||||||
|
|
||||||
|
|||||||
@@ -52,19 +52,19 @@ namespace Content.Shared.Placeable
|
|||||||
if (!surface.IsPlaceable)
|
if (!surface.IsPlaceable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedHandsComponent?>(args.User, out var handComponent))
|
if(!EntityManager.TryGetComponent<SharedHandsComponent?>(args.User, out var handComponent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!args.ClickLocation.IsValid(IoCManager.Resolve<IEntityManager>()))
|
if (!args.ClickLocation.IsValid(EntityManager))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!handComponent.TryDropEntity(args.Used, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(surface.Owner).Coordinates))
|
if(!handComponent.TryDropEntity(args.Used, EntityManager.GetComponent<TransformComponent>(surface.Owner).Coordinates))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (surface.PlaceCentered)
|
if (surface.PlaceCentered)
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Used).LocalPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Target).LocalPosition + surface.PositionOffset;
|
EntityManager.GetComponent<TransformComponent>(args.Used).LocalPosition = EntityManager.GetComponent<TransformComponent>(args.Target).LocalPosition + surface.PositionOffset;
|
||||||
else
|
else
|
||||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.Used).Coordinates = args.ClickLocation;
|
EntityManager.GetComponent<TransformComponent>(args.Used).Coordinates = args.ClickLocation;
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user