Inline Transform
This commit is contained in:
@@ -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