mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
23 lines
670 B
C#
23 lines
670 B
C#
using Content.Shared.Random;
|
|
using Content.Shared.Random.Helpers;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.Coordinates;
|
|
|
|
public sealed partial class SpawnRandomOffsetSystem : EntitySystem
|
|
{
|
|
[Dependency] private RandomHelperSystem _randomHelper = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SpawnRandomOffsetComponent, MapInitEvent>(OnMapInit);
|
|
}
|
|
|
|
private void OnMapInit(EntityUid uid, SpawnRandomOffsetComponent component, MapInitEvent args)
|
|
{
|
|
_randomHelper.RandomOffset(uid, component.Offset);
|
|
EntityManager.RemoveComponentDeferred(uid, component);
|
|
}
|
|
}
|