mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Fix JoinLFG crash
This commit is contained in:
parent
ea1ec98645
commit
4e64745861
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user