fix artifact scanning bug (#13767)

This commit is contained in:
Nemanja
2023-01-28 12:39:51 -05:00
committed by GitHub
parent 3d270bbb3e
commit a85a5029d3
2 changed files with 4 additions and 5 deletions

View File

@@ -6,13 +6,11 @@ using Robust.Shared.Random;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
/// <summary>
/// This handles...
/// </summary>
public sealed class RandomTeleportArtifactSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -25,6 +23,6 @@ public sealed class RandomTeleportArtifactSystem : EntitySystem
var xform = Transform(uid);
_popup.PopupCoordinates(Loc.GetString("blink-artifact-popup"), xform.Coordinates, PopupType.Medium);
xform.Coordinates = xform.Coordinates.Offset(_random.NextVector2(component.Range));
_xform.SetCoordinates(xform, xform.Coordinates.Offset(_random.NextVector2(component.Range)));
}
}

View File

@@ -10,6 +10,7 @@ public sealed class ShuffleArtifactSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -37,7 +38,7 @@ public sealed class ShuffleArtifactSystem : EntitySystem
foreach (var xform in toShuffle)
{
xform.Coordinates = _random.PickAndTake(allCoords);
_xform.SetCoordinates(xform, _random.PickAndTake(allCoords));
}
}
}