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
19 lines
584 B
C#
19 lines
584 B
C#
using Content.Shared.Buckle;
|
|
|
|
namespace Content.Server.Traits.Assorted;
|
|
|
|
public sealed partial class BuckleOnMapInitSystem : EntitySystem
|
|
{
|
|
[Dependency] private SharedBuckleSystem _buckleSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<BuckleOnMapInitComponent, MapInitEvent>(OnMapInit);
|
|
}
|
|
|
|
private void OnMapInit(EntityUid uid, BuckleOnMapInitComponent component, MapInitEvent args)
|
|
{
|
|
var buckle = Spawn(component.Prototype, Transform(uid).Coordinates);
|
|
_buckleSystem.TryBuckle(uid, uid, buckle);
|
|
}
|
|
}
|