From fb5f8dadbbb0d0f22923836bc84138f1d7158bff Mon Sep 17 00:00:00 2001 From: Morb <14136326+Morb0@users.noreply.github.com> Date: Sun, 13 Aug 2023 10:29:39 +0300 Subject: [PATCH] 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 --- .../Traits/Assorted/WheelchairBoundSystem.cs | 1 - .../Traits/Assorted/LegsParalyzedSystem.cs | 18 +++++++++++++++--- .../Entities/Objects/Vehicles/buckleable.yml | 3 +-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Content.Server/Traits/Assorted/WheelchairBoundSystem.cs b/Content.Server/Traits/Assorted/WheelchairBoundSystem.cs index c827d37681..11721c4070 100644 --- a/Content.Server/Traits/Assorted/WheelchairBoundSystem.cs +++ b/Content.Server/Traits/Assorted/WheelchairBoundSystem.cs @@ -16,6 +16,5 @@ public sealed class WheelchairBoundSystem : EntitySystem { var wheelchair = Spawn(component.WheelchairPrototype, Transform(uid).Coordinates); _buckleSystem.TryBuckle(uid, uid, wheelchair); - RemComp(uid); } } diff --git a/Content.Shared/Traits/Assorted/LegsParalyzedSystem.cs b/Content.Shared/Traits/Assorted/LegsParalyzedSystem.cs index 47d5999b30..7c91366937 100644 --- a/Content.Shared/Traits/Assorted/LegsParalyzedSystem.cs +++ b/Content.Shared/Traits/Assorted/LegsParalyzedSystem.cs @@ -1,8 +1,9 @@ using Content.Shared.Body.Systems; using Content.Shared.Buckle.Components; -using Content.Shared.Movement.Components; +using Content.Shared.Movement.Events; using Content.Shared.Movement.Systems; using Content.Shared.Standing; +using Content.Shared.Throwing; namespace Content.Shared.Traits.Assorted; @@ -17,13 +18,14 @@ public sealed class LegsParalyzedSystem : EntitySystem SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnShutdown); SubscribeLocalEvent(OnBuckleChange); + SubscribeLocalEvent(OnThrowPushbackAttempt); + SubscribeLocalEvent(OnUpdateCanMoveEvent); } private void OnStartup(EntityUid uid, LegsParalyzedComponent component, ComponentStartup args) { // TODO: In future probably must be surgery related wound - var movementSpeed = EnsureComp(uid); - _movementSpeedModifierSystem.ChangeBaseSpeed(uid, 0, 0, 20, movementSpeed); + _movementSpeedModifierSystem.ChangeBaseSpeed(uid, 0, 0, 20); } private void OnShutdown(EntityUid uid, LegsParalyzedComponent component, ComponentShutdown args) @@ -43,4 +45,14 @@ public sealed class LegsParalyzedSystem : EntitySystem _standingSystem.Down(args.BuckledEntity); } } + + private void OnUpdateCanMoveEvent(EntityUid uid, LegsParalyzedComponent component, UpdateCanMoveEvent args) + { + args.Cancel(); + } + + private void OnThrowPushbackAttempt(EntityUid uid, LegsParalyzedComponent component, ThrowPushbackAttemptEvent args) + { + args.Cancel(); + } } diff --git a/Resources/Prototypes/Entities/Objects/Vehicles/buckleable.yml b/Resources/Prototypes/Entities/Objects/Vehicles/buckleable.yml index f59b6f9398..99405988ea 100644 --- a/Resources/Prototypes/Entities/Objects/Vehicles/buckleable.yml +++ b/Resources/Prototypes/Entities/Objects/Vehicles/buckleable.yml @@ -431,7 +431,7 @@ id: VehicleWheelchair parent: [BaseVehicle, BaseFoldable, BaseItem] name: Wheelchair - description: A chair with big wheels. It looks like you can move in this on your own. + description: A chair with big wheels. It looks like you can move in these on your own. components: - type: Vehicle northOver: true @@ -446,7 +446,6 @@ - state: vehicle_folded map: ["foldedLayer"] visible: false - netsync: false noRot: true - type: MovementSpeedModifier baseWalkSpeed: 2