Remove transform methods from mapgrid (#12233)

This commit is contained in:
metalgearsloth
2022-11-01 11:27:18 +11:00
committed by GitHub
parent 297686c4ff
commit c9a2ab1cee
25 changed files with 144 additions and 78 deletions

View File

@@ -227,9 +227,10 @@ namespace Content.Server.Salvage
angle = Angle.Zero;
var tsc = Transform(component.Owner);
coords = new EntityCoordinates(component.Owner, component.Offset).ToMap(EntityManager);
if (_mapManager.TryGetGrid(tsc.GridUid, out var magnetGrid))
if (_mapManager.TryGetGrid(tsc.GridUid, out var magnetGrid) && TryComp<TransformComponent>(magnetGrid.GridEntityId, out var gridXform))
{
angle = magnetGrid.WorldRotation;
angle = gridXform.WorldRotation;
}
}
@@ -372,7 +373,7 @@ namespace Content.Server.Salvage
var gridId = gridIdAndState.Key;
// Not handling the case where the salvage we spawned got paused
// They both need to be paused, or it doesn't make sense
if (_mapManager.IsGridPaused(gridId)) continue;
if (MetaData(gridId).EntityPaused) continue;
state.CurrentTime += secondsPassed;
var deleteQueue = new RemQueue<SalvageMagnetComponent>();