Fix playglobalsound volume (#8208)
This commit is contained in:
@@ -52,21 +52,30 @@ public sealed class PlayGlobalSound : IConsoleCommand
|
||||
return;
|
||||
}
|
||||
|
||||
filter = Filter.Empty();
|
||||
|
||||
// Skip the first argument, which is the sound path.
|
||||
for (var i = 1 + volumeOffset; i < args.Length; i++)
|
||||
// No users specified so play for them all.
|
||||
if (args.Length == 2)
|
||||
{
|
||||
var username = args[i];
|
||||
|
||||
if (!_playerManager.TryGetSessionByUsername(username, out var session))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("play-global-sound-command-player-not-found", ("username", username)));
|
||||
continue;
|
||||
}
|
||||
|
||||
filter.AddPlayer(session);
|
||||
filter = Filter.Empty().AddAllPlayers(_playerManager);
|
||||
}
|
||||
else
|
||||
{
|
||||
filter = Filter.Empty();
|
||||
|
||||
// Skip the first argument, which is the sound path.
|
||||
for (var i = 1 + volumeOffset; i < args.Length; i++)
|
||||
{
|
||||
var username = args[i];
|
||||
|
||||
if (!_playerManager.TryGetSessionByUsername(username, out var session))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("play-global-sound-command-player-not-found", ("username", username)));
|
||||
continue;
|
||||
}
|
||||
|
||||
filter.AddPlayer(session);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user