refactor(Core/Channel): Cast moderation level to account types and avoid boolean evaluation. (#22283)

This commit is contained in:
Benjamin Jackson
2025-06-07 07:57:23 -04:00
committed by GitHub
parent b400dcfdb1
commit 416955907d

View File

@@ -1230,8 +1230,8 @@ void Channel::ToggleModeration(Player* player)
return;
}
const uint32 level = sWorld->getIntConfig(CONFIG_GM_LEVEL_CHANNEL_MODERATION);
const bool gm = (level && player->GetSession()->GetSecurity() >= level);
const AccountTypes level = static_cast<AccountTypes>(sWorld->getIntConfig(CONFIG_GM_LEVEL_CHANNEL_MODERATION));
const bool gm = (player->GetSession()->GetSecurity() >= level);
if (!playersStore[guid].IsModerator() && !gm)
{