mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
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
This commit is contained in:
committed by
Giacomo Pozzoni
parent
f163c2f96a
commit
ae8750716f
@@ -29,6 +29,7 @@ EndScriptData */
|
||||
#include "GuildMgr.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
@@ -87,7 +88,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;
|
||||
|
||||
Reference in New Issue
Block a user