Files
tbd-station-14/Content.Server/Traits/Assorted/WheelchairBoundSystem.cs
Morb fb5f8dadbb Wheelchair fixes (#18901)
* 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
2023-08-13 01:29:39 -06:00

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);
}
}