Inline Transform
This commit is contained in:
@@ -82,7 +82,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
{
|
||||
if (component.BeingDeletedByAnotherSingularity) return;
|
||||
|
||||
var worldPos = component.Owner.Transform.WorldPosition;
|
||||
var worldPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).WorldPosition;
|
||||
DestroyEntities(component, worldPos);
|
||||
DestroyTiles(component, worldPos);
|
||||
PullEntities(component, worldPos);
|
||||
@@ -141,7 +141,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
// The reason we don't /just/ use collision is because we'll be deleting stuff that may not necessarily have physics (e.g. carpets).
|
||||
var destroyRange = DestroyTileRange(component);
|
||||
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(component.Owner.Transform.MapID, worldPos, destroyRange))
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).MapID, worldPos, destroyRange))
|
||||
{
|
||||
HandleDestroy(component, entity);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
var pullRange = PullRange(component);
|
||||
var destroyRange = DestroyTileRange(component);
|
||||
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(component.Owner.Transform.MapID, worldPos, pullRange))
|
||||
foreach (var entity in _lookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).MapID, worldPos, pullRange))
|
||||
{
|
||||
// I tried having it so level 6 can de-anchor. BAD IDEA, MASSIVE LAG.
|
||||
if (entity == component.Owner ||
|
||||
@@ -171,7 +171,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
|
||||
if (!CanPull(entity)) continue;
|
||||
|
||||
var vec = worldPos - entity.Transform.WorldPosition;
|
||||
var vec = worldPos - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).WorldPosition;
|
||||
|
||||
if (vec.Length < destroyRange - 0.01f) continue;
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
var circle = new Circle(worldPos, radius);
|
||||
var box = new Box2(worldPos - radius, worldPos + radius);
|
||||
|
||||
foreach (var grid in _mapManager.FindGridsIntersecting(component.Owner.Transform.MapID, box))
|
||||
foreach (var grid in _mapManager.FindGridsIntersecting(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).MapID, box))
|
||||
{
|
||||
foreach (var tile in grid.GetTilesIntersecting(circle))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user