Skip to content

Commit f46da80

Browse files
authored
Merge 4034a47 into 050a010
2 parents 050a010 + 4034a47 commit f46da80

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/modules/Bots/playerbot/PlayerbotMgr.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,38 @@ list<string> PlayerbotHolder::HandlePlayerbotCommand(char* args, Player* master)
344344
}
345345
}
346346

347+
if (charnameStr == "all" && master && (cmdStr == "add" || cmdStr == "login"))
348+
{
349+
Group* group = master->GetGroup();
350+
if (!group)
351+
{
352+
messages.push_back("you must be in group");
353+
return messages;
354+
}
355+
356+
Group::MemberSlotList slots = group->GetMemberSlots();
357+
for (Group::member_citerator i = slots.begin(); i != slots.end(); i++)
358+
{
359+
ObjectGuid member = i->guid;
360+
361+
if (member == master->GetObjectGuid())
362+
{
363+
continue;
364+
}
365+
366+
if (sObjectMgr.GetPlayer(member))
367+
{
368+
continue;
369+
}
370+
371+
string botName;
372+
if (sObjectMgr.GetPlayerNameByGUID(member, botName))
373+
{
374+
bots.insert(botName);
375+
}
376+
}
377+
}
378+
347379
if (charnameStr == "!" && master && master->GetSession()->GetSecurity() > SEC_GAMEMASTER)
348380
{
349381
for (PlayerBotMap::const_iterator i = GetPlayerBotsBegin(); i != GetPlayerBotsEnd(); ++i)

0 commit comments

Comments
 (0)