Inline Transform

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:20:34 +01:00
parent 69b270017b
commit a5b57c8e10
283 changed files with 742 additions and 709 deletions

View File

@@ -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))
{