diff --git a/TTT/RTD/AutoRTDCommand.cs b/TTT/RTD/AutoRTDCommand.cs index 9be51bf..5f35837 100644 --- a/TTT/RTD/AutoRTDCommand.cs +++ b/TTT/RTD/AutoRTDCommand.cs @@ -25,6 +25,9 @@ public class AutoRTDCommand(IServiceProvider provider) : ICommand, IListener { private readonly IMsgLocalizer localizer = provider.GetRequiredService(); + private readonly IPermissionManager perms = + provider.GetRequiredService(); + private readonly Dictionary playerStatuses = new(); private ICookie? autoRtdCookie; public string Id => "autortd"; @@ -75,9 +78,10 @@ public class AutoRTDCommand(IServiceProvider provider) : ICommand, IListener { [UsedImplicitly] [EventHandler] public void OnRoundStart(GameInitEvent ev) { - var messenger = provider.GetRequiredService(); Task.Run(async () => { foreach (var player in finder.GetOnline()) { + if (!perms.HasFlags(player, RequiredFlags)) continue; + if (!playerStatuses.TryGetValue(player.Id, out var status)) { await fetchCookie(player); status = playerStatuses.GetValueOrDefault(player.Id, false);