* Remove netsync * Replace OnStartup with OnMapInit * Dont remove component * Remove component ensure * Remove using * Cancel all moving or stand events * Fix description * Revert "Replace OnStartup with OnMapInit" This reverts commit 5b7470d0dfa7a7c127dec6a06534b339f140ffac. * Remove stand events cancel
21 lines
649 B
C#
21 lines
649 B
C#
using Content.Shared.Buckle;
|
|
using Content.Shared.Traits.Assorted;
|
|
|
|
namespace Content.Server.Traits.Assorted;
|
|
|
|
public sealed class WheelchairBoundSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedBuckleSystem _buckleSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<WheelchairBoundComponent, ComponentStartup>(OnStartup);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, WheelchairBoundComponent component, ComponentStartup args)
|
|
{
|
|
var wheelchair = Spawn(component.WheelchairPrototype, Transform(uid).Coordinates);
|
|
_buckleSystem.TryBuckle(uid, uid, wheelchair);
|
|
}
|
|
}
|