Inline EntityManager

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:11:52 +01:00
parent bd18574412
commit 5e177ae734
108 changed files with 250 additions and 199 deletions

View File

@@ -49,7 +49,7 @@ namespace Content.Server.Storage.Components
private const string LoggerName = "Storage";
public Container? Storage;
private readonly Dictionary<IEntity, int> _sizeCache = new();
[DataField("occludesLight")]
@@ -462,13 +462,13 @@ namespace Content.Server.Storage.Components
var ownerTransform = Owner.Transform;
var playerTransform = player.Transform;
if (!playerTransform.Coordinates.InRange(Owner.EntityManager, ownerTransform.Coordinates, 2) ||
if (!playerTransform.Coordinates.InRange(IoCManager.Resolve<IEntityManager>(), ownerTransform.Coordinates, 2) ||
Owner.IsInContainer() && !playerTransform.ContainsEntity(ownerTransform))
{
break;
}
if (!Owner.EntityManager.TryGetEntity(remove.EntityUid, out var entity) || Storage?.Contains(entity) == false)
if (!IoCManager.Resolve<IEntityManager>().TryGetEntity(remove.EntityUid, out var entity) || Storage?.Contains(entity) == false)
{
break;
}