]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix small misc. turnstile issues (#36893)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Thu, 24 Apr 2025 17:02:12 +0000 (13:02 -0400)
committerGitHub <noreply@github.com>
Thu, 24 Apr 2025 17:02:12 +0000 (19:02 +0200)
* Fix small misc. turnstile issues

* more missing things

* quieter

Content.Shared/Doors/Components/TurnstileComponent.cs
Content.Shared/Doors/Systems/SharedTurnstileSystem.cs
Resources/Prototypes/Entities/Structures/Doors/turnstile.yml

index 5f19dd3e0b6911d9a3c7b2a0f7643755b060d703..3d7273fffa39544b16eb06b629c16c5f7e1419a9 100644 (file)
@@ -61,7 +61,13 @@ public sealed partial class TurnstileComponent : Component
     /// Sound to play when the turnstile denies entry
     /// </summary>
     [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]
index 0af6b913784e8abcc3803f926a8ff0aec941c60a..573c85ac004ea8e2d72eb010937e9ec00b5e6d00 100644 (file)
@@ -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)
index 0827492d11b63f6be81b9ed545dafe78477bd523..9434c9a892f2e28fbe6ff18f651f10f6a417cd21 100644 (file)
@@ -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"]]