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);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared.Database;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Chemistry.EntitySystems
|
||||
@@ -18,7 +19,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
|
||||
var entity = EntityManager.GetEntity(ownerUid);
|
||||
_logSystem.Add(LogType.ChemicalReaction, reaction.Impact,
|
||||
$"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {entity} at {entity.Transform.Coordinates}");
|
||||
$"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {entity} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).Coordinates}");
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(ownerUid, entityManager:EntityManager), reaction.Sound.GetSound(), ownerUid);
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
if (!string.IsNullOrEmpty(component.TargetPrototype))
|
||||
{
|
||||
var ent = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.TargetPrototype,
|
||||
owner.Transform.Coordinates);
|
||||
ent.Transform.AttachToGridOrMap();
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(owner.Uid).Coordinates);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent.Uid).AttachToGridOrMap();
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(owner.Uid);
|
||||
|
||||
@@ -97,12 +97,12 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
vapor.Timer += frameTime;
|
||||
vapor.ReactTimer += frameTime;
|
||||
|
||||
if (vapor.ReactTimer >= ReactTime && vapor.Owner.Transform.GridID.IsValid())
|
||||
if (vapor.ReactTimer >= ReactTime && IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(vapor.Owner.Uid).GridID.IsValid())
|
||||
{
|
||||
vapor.ReactTimer = 0;
|
||||
var mapGrid = _mapManager.GetGrid(entity.Transform.GridID);
|
||||
var mapGrid = _mapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).GridID);
|
||||
|
||||
var tile = mapGrid.GetTileRef(entity.Transform.Coordinates.ToVector2i(EntityManager, _mapManager));
|
||||
var tile = mapGrid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).Coordinates.ToVector2i(EntityManager, _mapManager));
|
||||
foreach (var reagentQuantity in contents.Contents.ToArray())
|
||||
{
|
||||
if (reagentQuantity.Quantity == FixedPoint2.Zero) continue;
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
|
||||
// Check if we've reached our target.
|
||||
if (!vapor.Reached &&
|
||||
vapor.Target.TryDistance(EntityManager, entity.Transform.Coordinates, out var distance) &&
|
||||
vapor.Target.TryDistance(EntityManager, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).Coordinates, out var distance) &&
|
||||
distance <= 0.5f)
|
||||
{
|
||||
vapor.Reached = true;
|
||||
|
||||
Reference in New Issue
Block a user