mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
feat(Core/Guild): Allow to limit the amount of members within a guild (#17697)
* feat(Core/Guild): Allow to limit the amount of members within a guild * Update Guild.cpp * Update Guild.cpp * Update Guild.cpp * Update Guild.cpp * improve message to player
This commit is contained in:
@@ -1440,6 +1440,14 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
|
||||
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
|
||||
return;
|
||||
|
||||
uint32 memberLimit = sConfigMgr->GetOption<uint32>("Guild.MemberLimit", 0);
|
||||
if (memberLimit > 0 && player->GetGuild()->GetMemberCount() >= memberLimit)
|
||||
{
|
||||
ChatHandler(player->GetSession()).PSendSysMessage("Your guild has reached the maximum amount of members (%u). You cannot send another invite until the guild member count is lower.", memberLimit);
|
||||
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_INTERNAL, name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeamId(true) != player->GetTeamId(true))
|
||||
{
|
||||
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_NOT_ALLIED, name);
|
||||
|
||||
Reference in New Issue
Block a user