Scripts/Commands: add some missing checks for .guild create command (#23201)

* Core/Conditions: implement CONDITION_GAMEMASTER

* Scripts/Commands: add some missing checks for .guild create command

(cherry picked from commit ae8750716f)
This commit is contained in:
ForesterDev
2019-04-24 18:58:56 +04:00
committed by Shauren
parent 93a9ee9c12
commit a2c0f6d321

View File

@@ -90,7 +90,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;