]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix anomaly locators frantically beeping when entering detection range. (#21178)
authorTemporalOroboros <TemporalOroboros@gmail.com>
Tue, 24 Oct 2023 21:00:22 +0000 (14:00 -0700)
committerGitHub <noreply@github.com>
Tue, 24 Oct 2023 21:00:22 +0000 (17:00 -0400)
* reset beep timer when out of range

* prevent deficit from impacting beep timing

Content.Server/Pinpointer/ProximityBeeperSystem.cs

index b473d973724e7620f70a4f9a03bcddc13367cc6e..d52223e2b4ec8247699848ca8a15093a1c537942 100644 (file)
@@ -80,7 +80,10 @@ public sealed class ProximityBeeperSystem : EntitySystem
 
         var scalingFactor = distance / component.MaximumDistance;
         var interval = (component.MaxBeepInterval - component.MinBeepInterval) * scalingFactor + component.MinBeepInterval;
+
         component.NextBeepTime += interval;
+        if (component.NextBeepTime < _timing.CurTime) // Prevents spending time out of range accumulating a deficit which causes a series of very rapid beeps when comeing into range.
+            component.NextBeepTime = _timing.CurTime + interval;
     }
 
     /// <summary>