From 416955907df4a4d02a771d84d0bb838372184c91 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sat, 7 Jun 2025 07:57:23 -0400 Subject: [PATCH] refactor(Core/Channel): Cast moderation level to account types and avoid boolean evaluation. (#22283) --- src/server/game/Chat/Channels/Channel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index e818508ed..b07223030 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -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(sWorld->getIntConfig(CONFIG_GM_LEVEL_CHANNEL_MODERATION)); + const bool gm = (player->GetSession()->GetSecurity() >= level); if (!playersStore[guid].IsModerator() && !gm) {