Admins can now bypass cooldowns

This commit is contained in:
zontreck 2025-03-07 11:49:59 -07:00
parent cd00e620c3
commit 700de94ffe
2 changed files with 9 additions and 2 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Common.CommandAbbr;
@ -225,6 +226,12 @@ namespace AriasServerUtils
{
foreach (var cdEntry in ServerUtilities.mPlayerData)
{
// Obtain the IServerPlayer instance for this player.
IServerPlayer player = API.Server.Players.First(x => x.PlayerName == cdEntry.Key);
if (player.HasPrivilege(Privilege.controlserver) && ServerUtilities.config.AdminsBypassCooldowns)
{
cdEntry.Value.ActiveCooldowns.Clear(); // Problem solved.
}
List<CooldownType> toRemove = new();
foreach (var cd in cdEntry.Value.ActiveCooldowns)
{