From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:02:12 +0000 (-0400) Subject: Fix small misc. turnstile issues (#36893) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=68881ac0308122889b57c8fceb092d4e36207e3e;p=space-station-14.git Fix small misc. turnstile issues (#36893) * Fix small misc. turnstile issues * more missing things * quieter --- 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"]]