mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Interaction] Set the group inviter as master instead of the group leader
This commit is contained in:
@@ -4,17 +4,24 @@
|
|||||||
|
|
||||||
#include "AcceptInvitationAction.h"
|
#include "AcceptInvitationAction.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "ObjectAccessor.h"
|
||||||
#include "PlayerbotAIConfig.h"
|
#include "PlayerbotAIConfig.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "PlayerbotSecurity.h"
|
#include "PlayerbotSecurity.h"
|
||||||
|
#include "WorldPacket.h"
|
||||||
|
|
||||||
bool AcceptInvitationAction::Execute(Event event)
|
bool AcceptInvitationAction::Execute(Event event)
|
||||||
{
|
{
|
||||||
Group* grp = bot->GetGroupInvite();
|
Group* grp = bot->GetGroupInvite();
|
||||||
if (!grp)
|
if (!grp)
|
||||||
return false;
|
return false;
|
||||||
|
WorldPacket packet = event.getPacket();
|
||||||
|
uint8 flag;
|
||||||
|
std::string name;
|
||||||
|
packet >> flag >> name;
|
||||||
|
|
||||||
Player* inviter = ObjectAccessor::FindPlayer(grp->GetLeaderGUID());
|
// Player* inviter = ObjectAccessor::FindPlayer(grp->GetLeaderGUID());
|
||||||
|
Player* inviter = ObjectAccessor::FindPlayerByName(name, true);
|
||||||
if (!inviter)
|
if (!inviter)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user