refactor(Core/Channel): Cast moderation level to account types and avoid boolean evaluation. (#22283)
This commit is contained in:
@@ -1230,8 +1230,8 @@ void Channel::ToggleModeration(Player* player)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32 level = sWorld->getIntConfig(CONFIG_GM_LEVEL_CHANNEL_MODERATION);
|
const AccountTypes level = static_cast<AccountTypes>(sWorld->getIntConfig(CONFIG_GM_LEVEL_CHANNEL_MODERATION));
|
||||||
const bool gm = (level && player->GetSession()->GetSecurity() >= level);
|
const bool gm = (player->GetSession()->GetSecurity() >= level);
|
||||||
|
|
||||||
if (!playersStore[guid].IsModerator() && !gm)
|
if (!playersStore[guid].IsModerator() && !gm)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user