]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix bwoink sounds (#25441)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 21 Feb 2024 22:14:57 +0000 (09:14 +1100)
committerGitHub <noreply@github.com>
Wed, 21 Feb 2024 22:14:57 +0000 (16:14 -0600)
* Fix bwoink sounds

Didn't get a chance to test with 2 clients as I'm about to sleep but otherwise I'll check tomorrow.

* a

Content.Server/Administration/Systems/BwoinkSystem.cs

index ffbe2e5ed6fa4c9ab887040869dc64e52405dc2e..2e236688ac3e2f5546e5b35b5cd7e241ced9ff00 100644 (file)
@@ -72,7 +72,7 @@ namespace Content.Server.Administration.Systems
             Subs.CVar(_config, CVars.GameHostName, OnServerNameChanged, true);
             Subs.CVar(_config, CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
             _sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
-            _maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, false).Length;
+            _maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: false).Length;
             _playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
 
             SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameRunLevelChanged);
@@ -411,7 +411,8 @@ namespace Content.Server.Administration.Systems
 
             bwoinkText = $"{(message.PlaySound ? "" : "(S) ")}{bwoinkText}: {escapedText}";
 
-            var playSound = senderAHelpAdmin && message.PlaySound;
+            // If it's not an admin / admin chooses to keep the sound then play it.
+            var playSound = !senderAHelpAdmin || message.PlaySound;
             var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText, playSound: playSound);
 
             LogBwoink(msg);
@@ -470,7 +471,7 @@ namespace Content.Server.Administration.Systems
                     str = str[..(DescriptionMax - _maxAdditionalChars - unameLength)];
                 }
                 var nonAfkAdmins = GetNonAfkAdmins();
-                _messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playSound, nonAfkAdmins.Count == 0));
+                _messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: playSound, noReceivers: nonAfkAdmins.Count == 0));
             }
 
             if (admins.Count != 0 || sendsWebhook)