Code cleanup: Purge calls to obsolete EntityCoordinates methods (#26292)

* Purge calls to obsolete EntityCoordinates methods

* Pizza defruited; rerun those tests!
This commit is contained in:
Tayrtahn
2024-03-20 21:59:56 -04:00
committed by GitHub
parent b34777177c
commit f4cb02fb0c
34 changed files with 70 additions and 56 deletions

View File

@@ -19,8 +19,9 @@ namespace Content.Shared.Construction.Conditions
var entManager = IoCManager.Resolve<IEntityManager>();
// get blueprint and user position
var transformSystem = entManager.System<SharedTransformSystem>();
var userWorldPosition = entManager.GetComponent<TransformComponent>(user).WorldPosition;
var objWorldPosition = location.ToMap(entManager).Position;
var objWorldPosition = location.ToMap(entManager, transformSystem).Position;
// find direction from user to blueprint
var userToObject = (objWorldPosition - userWorldPosition);

View File

@@ -220,7 +220,7 @@ namespace Content.Shared.Examine
{
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = other.ToMap(entMan);
var otherPos = other.ToMap(entMan, _transform);
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}

View File

@@ -114,7 +114,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
&& (itemPos.Position - xform.MapPosition.Position).Length() <= MaxAnimationRange
&& MetaData(entity).VisibilityMask == MetaData(uid).VisibilityMask) // Don't animate aghost pickups.
{
var initialPosition = EntityCoordinates.FromMap(coordinateEntity, itemPos, EntityManager);
var initialPosition = EntityCoordinates.FromMap(coordinateEntity, itemPos, TransformSystem, EntityManager);
_storage.PlayPickupAnimation(entity, initialPosition, xform.Coordinates, itemXform.LocalRotation, uid);
}
}

View File

@@ -459,7 +459,7 @@ namespace Content.Shared.Interaction
return false;
if (!HasComp<NoRotateOnInteractComponent>(user))
_rotateToFaceSystem.TryFaceCoordinates(user, coordinates.ToMapPos(EntityManager));
_rotateToFaceSystem.TryFaceCoordinates(user, coordinates.ToMapPos(EntityManager, _transform));
return true;
}
@@ -612,7 +612,7 @@ namespace Content.Shared.Interaction
Ignored combinedPredicate = e => e == origin || (predicate?.Invoke(e) ?? false);
var inRange = true;
MapCoordinates originPos = default;
var targetPos = otherCoordinates.ToMap(EntityManager);
var targetPos = otherCoordinates.ToMap(EntityManager, _transform);
Angle targetRot = default;
// So essentially:
@@ -785,7 +785,7 @@ namespace Content.Shared.Interaction
Ignored? predicate = null,
bool popup = false)
{
return InRangeUnobstructed(origin, other.ToMap(EntityManager), range, collisionMask, predicate, popup);
return InRangeUnobstructed(origin, other.ToMap(EntityManager, _transform), range, collisionMask, predicate, popup);
}
/// <summary>

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Spawning
SharedPhysicsSystem? physicsManager = null)
{
physicsManager ??= entityManager.System<SharedPhysicsSystem>();
var mapCoordinates = coordinates.ToMap(entityManager);
var mapCoordinates = coordinates.ToMap(entityManager, entityManager.System<SharedTransformSystem>());
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
}