mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix JoinLFG crash
This commit is contained in:
@@ -8,10 +8,14 @@
|
||||
#include "AiFactory.h"
|
||||
#include "ItemVisitors.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "LFGPackets.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Playerbots.h"
|
||||
#include "World.h"
|
||||
|
||||
using namespace lfg;
|
||||
|
||||
|
||||
bool LfgJoinAction::Execute(Event event) { return JoinLFG(); }
|
||||
|
||||
uint32 LfgJoinAction::GetRoles()
|
||||
@@ -146,7 +150,19 @@ bool LfgJoinAction::JoinLFG()
|
||||
|
||||
// Set RbotAId Browser comment
|
||||
std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot, false, false));
|
||||
sLFGMgr->JoinLfg(bot, roleMask, list, _gs);
|
||||
|
||||
WorldPacket* data = new WorldPacket(CMSG_LFG_JOIN);
|
||||
*data << (uint32)roleMask;
|
||||
*data << (bool)false;
|
||||
*data << (bool)false;
|
||||
// Slots
|
||||
*data << (uint8)(list.size());
|
||||
for (uint32 dungeon : list)
|
||||
*data << (uint32)dungeon;
|
||||
// Needs
|
||||
*data << (uint8)3 << (uint8)0 << (uint8)0 << (uint8)0;
|
||||
*data << _gs;
|
||||
bot->GetSession()->QueuePacket(data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user