Inline EntityManager
This commit is contained in:
@@ -162,7 +162,7 @@ namespace Content.Server.Cargo.Components
|
||||
// TODO replace with shuttle code
|
||||
// TEMPORARY loop for spawning stuff on telepad (looks for a telepad adjacent to the console)
|
||||
IEntity? cargoTelepad = null;
|
||||
var indices = Owner.Transform.Coordinates.ToVector2i(Owner.EntityManager, _mapManager);
|
||||
var indices = Owner.Transform.Coordinates.ToVector2i(IoCManager.Resolve<IEntityManager>(), _mapManager);
|
||||
var offsets = new Vector2i[] { new Vector2i(0, 1), new Vector2i(1, 1), new Vector2i(1, 0), new Vector2i(1, -1),
|
||||
new Vector2i(0, -1), new Vector2i(-1, -1), new Vector2i(-1, 0), new Vector2i(-1, 1), };
|
||||
var adjacentEntities = new List<IEnumerable<IEntity>>(); //Probably better than IEnumerable.concat
|
||||
|
||||
@@ -119,13 +119,13 @@ namespace Content.Server.Cargo.Components
|
||||
if (!_prototypeManager.TryIndex(data.ProductId, out CargoProductPrototype? prototype))
|
||||
return;
|
||||
|
||||
var product = Owner.EntityManager.SpawnEntity(prototype.Product, Owner.Transform.Coordinates);
|
||||
var product = IoCManager.Resolve<IEntityManager>().SpawnEntity(prototype.Product, Owner.Transform.Coordinates);
|
||||
|
||||
product.Transform.Anchored = false;
|
||||
|
||||
// spawn a piece of paper.
|
||||
var printed = Owner.EntityManager.SpawnEntity(PrinterOutput, Owner.Transform.Coordinates);
|
||||
if (!Owner.EntityManager.TryGetComponent(printed.Uid, out PaperComponent paper))
|
||||
var printed = IoCManager.Resolve<IEntityManager>().SpawnEntity(PrinterOutput, Owner.Transform.Coordinates);
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(printed.Uid, out PaperComponent paper))
|
||||
return;
|
||||
|
||||
// fill in the order data
|
||||
@@ -138,7 +138,7 @@ namespace Content.Server.Cargo.Components
|
||||
("approver", data.Approver)));
|
||||
|
||||
// attempt to attach the label
|
||||
if (Owner.EntityManager.TryGetComponent(product.Uid, out PaperLabelComponent label))
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(product.Uid, out PaperLabelComponent label))
|
||||
{
|
||||
EntitySystem.Get<ItemSlotsSystem>().TryInsert(OwnerUid, label.LabelSlot, printed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user