Fix small misc. turnstile issues (#36893)

* Fix small misc. turnstile issues

* more missing things

* quieter
This commit is contained in:
Nemanja
2025-04-24 13:02:12 -04:00
committed by GitHub
parent 1f722bcc44
commit 68881ac030
3 changed files with 15 additions and 5 deletions

View 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]

View 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)

View 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"]]