diff --git a/Content.Shared/Pulling/Components/PullableComponent.cs b/Content.Shared/Pulling/Components/PullableComponent.cs index b806e7fe33..a822e67910 100644 --- a/Content.Shared/Pulling/Components/PullableComponent.cs +++ b/Content.Shared/Pulling/Components/PullableComponent.cs @@ -11,8 +11,6 @@ namespace Content.Shared.Pulling.Components [RegisterComponent] public sealed class SharedPullableComponent : Component { - public float? MaxDistance => PullJoint?.MaxLength; - /// /// The current entity pulling this component. /// SharedPullingStateManagementSystem should be writing this. This means definitely not you. @@ -29,6 +27,20 @@ namespace Content.Shared.Pulling.Components [Access(typeof(SharedPullingStateManagementSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends public EntityCoordinates? MovingTo { get; set; } + /// + /// If the physics component has FixedRotation should we keep it upon being pulled + /// + [Access(typeof(SharedPullingSystem), Other = AccessPermissions.ReadExecute)] + [ViewVariables(VVAccess.ReadWrite), DataField("fixedRotation")] + public bool FixedRotationOnPull { get; set; } + + /// + /// What the pullable's fixedrotation was set to before being pulled. + /// + [Access(typeof(SharedPullingSystem), Other = AccessPermissions.ReadExecute)] + [ViewVariables] + public bool PrevFixedRotation; + public override ComponentState GetComponentState() { return new PullableComponentState(Puller); diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index c73694d7ee..723b10a2a9 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -85,6 +85,13 @@ namespace Content.Shared.Pulling if (msg.Cancelled) return false; + // Stop pulling confirmed! + + if (TryComp(pullable.Owner, out var pullablePhysics)) + { + pullablePhysics.FixedRotation = pullable.PrevFixedRotation; + } + _pullSm.ForceRelationship(null, pullable); return true; } @@ -172,11 +179,11 @@ namespace Content.Shared.Pulling RaiseLocalEvent(pullable.Owner, pullAttempt); if (pullAttempt.Cancelled) - { return false; - } _pullSm.ForceRelationship(puller, pullable); + pullable.PrevFixedRotation = pullablePhysics.FixedRotation; + pullablePhysics.FixedRotation = pullable.FixedRotationOnPull; return true; } diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml index d20509f1e7..0f2a23b7aa 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml @@ -52,7 +52,6 @@ - Wringer - type: Physics bodyType: Dynamic - fixedRotation: false - type: Transform noRot: true - type: Fixtures diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml index 8e6a5994f5..883faa53f7 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml @@ -27,7 +27,6 @@ - type: MovedByPressure - type: Physics bodyType: Dynamic - fixedRotation: false - type: Transform noRot: true - type: Fixtures diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml index a611750c84..d655388c4d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml @@ -25,7 +25,6 @@ maxIntensity: 45 - type: Physics bodyType: Dynamic - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Objects/base_item.yml b/Resources/Prototypes/Entities/Objects/base_item.yml index 8498733c36..98b6976d32 100644 --- a/Resources/Prototypes/Entities/Objects/base_item.yml +++ b/Resources/Prototypes/Entities/Objects/base_item.yml @@ -21,7 +21,6 @@ modifier: 0.5 - type: Physics bodyType: Dynamic - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml index f06a3f9bf6..a4840f2fa6 100644 --- a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml +++ b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml @@ -11,7 +11,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/assembly.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/assembly.yml index 7529eff354..7418ad8dee 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/assembly.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/assembly.yml @@ -10,7 +10,6 @@ sprite: Structures/Doors/Airlocks/Standard/basic.rsi state: "assembly" - type: Physics - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml index 686dcb94ee..365166c4ff 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/frame.yml @@ -6,7 +6,6 @@ components: - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Machines/frame.yml b/Resources/Prototypes/Entities/Structures/Machines/frame.yml index 36ee3bfe95..a4b51770a6 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/frame.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/frame.yml @@ -11,7 +11,6 @@ noRot: true - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: @@ -59,7 +58,6 @@ noRot: true - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: @@ -114,8 +112,6 @@ - type: Construction graph: Machine node: destroyedMachineFrame - - type: Physics - fixedRotation: false - type: Damageable damageContainer: Inorganic damageModifierSet: Metallic diff --git a/Resources/Prototypes/Entities/Structures/Piping/Disposal/high_pressure_machine_frame.yml b/Resources/Prototypes/Entities/Structures/Piping/Disposal/high_pressure_machine_frame.yml index 43cb3bfee2..82373b19a8 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Disposal/high_pressure_machine_frame.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Disposal/high_pressure_machine_frame.yml @@ -10,7 +10,6 @@ noRot: true - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/base_particleaccelerator.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/base_particleaccelerator.yml index f984fad200..e29b50743d 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/base_particleaccelerator.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/base_particleaccelerator.yml @@ -9,7 +9,6 @@ - type: Rotatable - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/collector.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/collector.yml index e07d42d2db..08e3bf0530 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/collector.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/collector.yml @@ -9,7 +9,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml index ece4e2d167..f430c6d5cd 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/emitter.yml @@ -9,7 +9,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: @@ -75,4 +74,4 @@ graph: Machine node: machine - type: Machine - board: EmitterCircuitboard \ No newline at end of file + board: EmitterCircuitboard diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/generator.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/generator.yml index ef70b21dc2..16f2f5eca9 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/generator.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/generator.yml @@ -14,7 +14,6 @@ - type: Clickable - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml index 1c8ca857f2..9df2dcdb41 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml @@ -11,7 +11,6 @@ sprite: Structures/Power/Generation/ame.rsi state: control - type: Physics - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml index 52b1bfd548..9a659a181f 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml @@ -16,7 +16,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml index 5fa17d3641..5e5af7e8b4 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml @@ -16,7 +16,6 @@ anchored: true - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: @@ -111,7 +110,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: @@ -155,7 +153,6 @@ - type: InteractionOutline - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/base_structure.yml b/Resources/Prototypes/Entities/Structures/base_structure.yml index 841d1839dd..a486260f88 100644 --- a/Resources/Prototypes/Entities/Structures/base_structure.yml +++ b/Resources/Prototypes/Entities/Structures/base_structure.yml @@ -9,7 +9,6 @@ - type: Clickable - type: Physics bodyType: Static - fixedRotation: false - type: Fixtures fixtures: - shape: diff --git a/Resources/Prototypes/Entities/Structures/hydro_tray.yml b/Resources/Prototypes/Entities/Structures/hydro_tray.yml index 5253c523e2..756d53fa70 100644 --- a/Resources/Prototypes/Entities/Structures/hydro_tray.yml +++ b/Resources/Prototypes/Entities/Structures/hydro_tray.yml @@ -4,8 +4,6 @@ id: hydroponicsTray description: An interstellar-grade space farmplot allowing for rapid growth and selective breeding of crops. Just... keep in mind the space weeds. components: - - type: Physics - fixedRotation: false - type: Transform noRot: true - type: Fixtures