Inline Transform
This commit is contained in:
@@ -162,13 +162,13 @@ 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(IoCManager.Resolve<IEntityManager>(), _mapManager);
|
||||
var indices = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).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
|
||||
foreach (var offset in offsets)
|
||||
{
|
||||
adjacentEntities.Add((indices+offset).GetEntitiesInTileFast(Owner.Transform.GridID));
|
||||
adjacentEntities.Add((indices+offset).GetEntitiesInTileFast(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).GridID));
|
||||
}
|
||||
|
||||
foreach (var enumerator in adjacentEntities)
|
||||
|
||||
@@ -119,12 +119,12 @@ namespace Content.Server.Cargo.Components
|
||||
if (!_prototypeManager.TryIndex(data.ProductId, out CargoProductPrototype? prototype))
|
||||
return;
|
||||
|
||||
var product = IoCManager.Resolve<IEntityManager>().SpawnEntity(prototype.Product, Owner.Transform.Coordinates);
|
||||
var product = IoCManager.Resolve<IEntityManager>().SpawnEntity(prototype.Product, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
|
||||
product.Transform.Anchored = false;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(product.Uid).Anchored = false;
|
||||
|
||||
// spawn a piece of paper.
|
||||
var printed = IoCManager.Resolve<IEntityManager>().SpawnEntity(PrinterOutput, Owner.Transform.Coordinates);
|
||||
var printed = IoCManager.Resolve<IEntityManager>().SpawnEntity(PrinterOutput, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(printed.Uid, out PaperComponent paper))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user