Inline Transform
This commit is contained in:
@@ -302,7 +302,7 @@ namespace Content.Server.Chemistry.Components
|
||||
var actualVolume = FixedPoint2.Min(individualVolume, FixedPoint2.New(30));
|
||||
for (int i = 0; i < bottleAmount; i++)
|
||||
{
|
||||
var bottle = IoCManager.Resolve<IEntityManager>().SpawnEntity("ChemistryEmptyBottle01", Owner.Transform.Coordinates);
|
||||
var bottle = IoCManager.Resolve<IEntityManager>().SpawnEntity("ChemistryEmptyBottle01", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
|
||||
//Adding label
|
||||
LabelComponent labelComponent = bottle.EnsureComponent<LabelComponent>();
|
||||
@@ -327,7 +327,7 @@ namespace Content.Server.Chemistry.Components
|
||||
}
|
||||
|
||||
//Put it on the floor
|
||||
bottle.Transform.Coordinates = user.Transform.Coordinates;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(bottle.Uid).Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates;
|
||||
//Give it an offset
|
||||
bottle.RandomOffset(0.2f);
|
||||
}
|
||||
@@ -344,7 +344,7 @@ namespace Content.Server.Chemistry.Components
|
||||
var actualVolume = FixedPoint2.Min(individualVolume, FixedPoint2.New(50));
|
||||
for (int i = 0; i < pillAmount; i++)
|
||||
{
|
||||
var pill = IoCManager.Resolve<IEntityManager>().SpawnEntity("pill", Owner.Transform.Coordinates);
|
||||
var pill = IoCManager.Resolve<IEntityManager>().SpawnEntity("pill", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
|
||||
//Adding label
|
||||
LabelComponent labelComponent = pill.EnsureComponent<LabelComponent>();
|
||||
@@ -375,7 +375,7 @@ namespace Content.Server.Chemistry.Components
|
||||
}
|
||||
|
||||
//Put it on the floor
|
||||
pill.Transform.Coordinates = user.Transform.Coordinates;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pill.Uid).Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates;
|
||||
//Give it an offset
|
||||
pill.RandomOffset(0.2f);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Content.Server.Chemistry.Components
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_foamedMetalPrototype))
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_foamedMetalPrototype, Owner.Transform.Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().SpawnEntity(_foamedMetalPrototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Content.Server.Chemistry.Components
|
||||
{
|
||||
target.PopupMessage(Loc.GetString("hypospray-component-feel-prick-message"));
|
||||
var meleeSys = EntitySystem.Get<MeleeWeaponSystem>();
|
||||
var angle = Angle.FromWorldVec(target.Transform.WorldPosition - user.Transform.WorldPosition);
|
||||
var angle = Angle.FromWorldVec(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(target.Uid).WorldPosition - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).WorldPosition);
|
||||
meleeSys.SendLunge(angle, user);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace Content.Server.Chemistry.Components
|
||||
|
||||
void SpreadToDir(Direction dir)
|
||||
{
|
||||
var grid = MapManager.GetGrid(Owner.Transform.GridID);
|
||||
var coords = Owner.Transform.Coordinates;
|
||||
var grid = MapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).GridID);
|
||||
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates;
|
||||
foreach (var neighbor in grid.GetInDir(coords, dir))
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(neighbor,
|
||||
@@ -132,8 +132,8 @@ namespace Content.Server.Chemistry.Components
|
||||
return;
|
||||
|
||||
var chemistry = EntitySystem.Get<ReactiveSystem>();
|
||||
var mapGrid = MapManager.GetGrid(Owner.Transform.GridID);
|
||||
var tile = mapGrid.GetTileRef(Owner.Transform.Coordinates.ToVector2i(IoCManager.Resolve<IEntityManager>(), MapManager));
|
||||
var mapGrid = MapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).GridID);
|
||||
var tile = mapGrid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates.ToVector2i(IoCManager.Resolve<IEntityManager>(), MapManager));
|
||||
|
||||
var solutionFraction = 1 / Math.Floor(averageExposures);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user