fix(Core/Misc): fix some exploits (#2630)

This commit is contained in:
Viste
2020-02-18 10:26:12 +03:00
committed by GitHub
parent 3b5b7a506f
commit 38e8503d21
3 changed files with 46 additions and 10 deletions

View File

@@ -72,7 +72,22 @@ public:
if (target->GetGuildId())
{
handler->SendSysMessage(LANG_PLAYER_IN_GUILD);
return true;
handler->SetSentErrorMessage(true);
return false;
}
if (sGuildMgr->GetGuildByName(guildName))
{
handler->SendSysMessage(LANG_GUILD_RENAME_ALREADY_EXISTS);
handler->SetSentErrorMessage(true);
return false;
}
if (sObjectMgr->IsReservedName(guildName) || !sObjectMgr->IsValidCharterName(guildName))
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
Guild* guild = new Guild;