aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Accounts/AccountMgr.cpp49
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp2
2 files changed, 6 insertions, 45 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index c8870a82966..f2478ae4a6c 100755
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -222,66 +222,27 @@ std::string CalculateShaPassHash(std::string& name, std::string& password)
bool IsPlayerAccount(uint32 gmlevel)
{
- switch (gmlevel)
- {
- case SEC_CONSOLE:
- case SEC_ADMINISTRATOR:
- case SEC_GAMEMASTER:
- case SEC_MODERATOR:
- return false;
- default:
- return true;
- }
+ return gmlevel = SEC_PLAYER;
}
bool IsModeratorAccount(uint32 gmlevel)
{
- switch (gmlevel)
- {
- case SEC_CONSOLE:
- case SEC_ADMINISTRATOR:
- case SEC_GAMEMASTER:
- case SEC_MODERATOR:
- return true;
- default:
- return false;
- }
+ return gmlevel >= SEC_MODERATOR && gmlevel <= SEC_CONSOLE;
}
bool IsGMAccount(uint32 gmlevel)
{
- switch (gmlevel)
- {
- case SEC_CONSOLE:
- case SEC_ADMINISTRATOR:
- case SEC_GAMEMASTER:
- return true;
- default:
- return false;
- }
+ return gmlevel >= SEC_GAMEMASTER && gmlevel <= SEC_CONSOLE;
}
bool IsAdminAccount(uint32 gmlevel)
{
- switch (gmlevel)
- {
- case SEC_CONSOLE:
- case SEC_ADMINISTRATOR:
- return true;
- default:
- return false;
- }
+ return gmlevel >= SEC_ADMINISTRATOR && gmlevel <= SEC_CONSOLE;
}
bool IsConsoleAccount(uint32 gmlevel)
{
- switch (gmlevel)
- {
- case SEC_CONSOLE:
- return true;
- default:
- return false;
- }
+ return gmlevel = SEC_CONSOLE;
}
} // Namespace AccountMgr
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 45e8dcd5eb5..780b4e549a9 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -122,7 +122,7 @@ public:
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
- if ((itr->second->isGameMaster() || !AccountMgr::IsPlayerAccount((itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
+ if ((itr->second->isGameMaster() || (!AccountMgr::IsPlayerAccount(itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
{
if (first)