Resolve 'TransformComponent.MapPosition' is obsolete in content (#27939)

* Resolve `'TransformComponent.MapPosition' is obsolete: 'Use TransformSystem.GetMapCoordinates'` in content

* build?
This commit is contained in:
Kara
2024-05-12 07:31:54 -07:00
committed by GitHub
parent 8938e1d8b2
commit 855234aa30
59 changed files with 152 additions and 84 deletions

View File

@@ -165,7 +165,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
var range2 = range * range;
var xformQuery = EntityManager.GetEntityQuery<TransformComponent>();
var epicenter = _xformSystem.GetWorldPosition(xform, xformQuery);
foreach (var entity in _lookup.GetEntitiesInRange(xform.MapPosition, range, flags: LookupFlags.Uncontained))
foreach (var entity in _lookup.GetEntitiesInRange(_xformSystem.GetMapCoordinates(uid, xform), range, flags: LookupFlags.Uncontained))
{
if (entity == uid)
continue;
@@ -295,7 +295,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
if (!Resolve(uid, ref xform) || !Resolve(uid, ref eventHorizon))
return;
var mapPos = xform.MapPosition;
var mapPos = _xformSystem.GetMapCoordinates(uid, xform: xform);
var box = Box2.CenteredAround(mapPos.Position, new Vector2(range, range));
var circle = new Circle(mapPos.Position, range);
var grids = new List<Entity<MapGridComponent>>();