diff --git a/Content.Shared/Doors/Components/TurnstileComponent.cs b/Content.Shared/Doors/Components/TurnstileComponent.cs index 5f19dd3e0b..3d7273fffa 100644 --- a/Content.Shared/Doors/Components/TurnstileComponent.cs +++ b/Content.Shared/Doors/Components/TurnstileComponent.cs @@ -61,7 +61,13 @@ public sealed partial class TurnstileComponent : Component /// Sound to play when the turnstile denies entry /// [DataField] - public SoundSpecifier? DenySound = new SoundPathSpecifier("/Audio/Machines/airlock_deny.ogg"); + public SoundSpecifier? DenySound = new SoundPathSpecifier("/Audio/Machines/airlock_deny.ogg") + { + Params = new() + { + Volume = -7, + }, + }; } [Serializable, NetSerializable] diff --git a/Content.Shared/Doors/Systems/SharedTurnstileSystem.cs b/Content.Shared/Doors/Systems/SharedTurnstileSystem.cs index 0af6b91378..573c85ac00 100644 --- a/Content.Shared/Doors/Systems/SharedTurnstileSystem.cs +++ b/Content.Shared/Doors/Systems/SharedTurnstileSystem.cs @@ -120,8 +120,12 @@ public abstract partial class SharedTurnstileSystem : EntitySystem var approachAngle = (pos - otherPos).ToAngle(); var rotateAngle = rot.ToWorldVec().ToAngle(); - var dif = Math.Min(Math.Abs(approachAngle.Theta - rotateAngle.Theta), Math.Abs(rotateAngle.Theta - approachAngle.Theta)); - return dif < Math.PI / 4; + var diff = Math.Abs(approachAngle - rotateAngle); + diff %= MathHelper.TwoPi; + if (diff > Math.PI) + diff = MathHelper.TwoPi - diff; + + return diff < Math.PI / 4; } protected virtual void PlayAnimation(EntityUid uid, string stateId) diff --git a/Resources/Prototypes/Entities/Structures/Doors/turnstile.yml b/Resources/Prototypes/Entities/Structures/Doors/turnstile.yml index 0827492d11..9434c9a892 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/turnstile.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/turnstile.yml @@ -84,7 +84,7 @@ suffix: Genpop Enter components: - type: AccessReader - access: [["GenpopEnter"]] + access: [["GenpopEnter"], ["Security"]] - type: entity id: TurnstileGenpopLeave @@ -92,4 +92,4 @@ suffix: Genpop Leave components: - type: AccessReader - access: [["GenpopLeave"]] + access: [["GenpopLeave"], ["Security"]]