mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Merge pull request #799 from liyunfan1223/fix_joinlfg
Fix JoinLFG crash
This commit is contained in:
@@ -8,10 +8,14 @@
|
|||||||
#include "AiFactory.h"
|
#include "AiFactory.h"
|
||||||
#include "ItemVisitors.h"
|
#include "ItemVisitors.h"
|
||||||
#include "LFGMgr.h"
|
#include "LFGMgr.h"
|
||||||
|
#include "LFGPackets.h"
|
||||||
|
#include "Opcodes.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
|
#include "World.h"
|
||||||
|
|
||||||
using namespace lfg;
|
using namespace lfg;
|
||||||
|
|
||||||
|
|
||||||
bool LfgJoinAction::Execute(Event event) { return JoinLFG(); }
|
bool LfgJoinAction::Execute(Event event) { return JoinLFG(); }
|
||||||
|
|
||||||
uint32 LfgJoinAction::GetRoles()
|
uint32 LfgJoinAction::GetRoles()
|
||||||
@@ -146,7 +150,22 @@ bool LfgJoinAction::JoinLFG()
|
|||||||
|
|
||||||
// Set RbotAId Browser comment
|
// Set RbotAId Browser comment
|
||||||
std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot, false, false));
|
std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot, false, false));
|
||||||
sLFGMgr->JoinLfg(bot, roleMask, list, _gs);
|
|
||||||
|
// JoinLfg is not threadsafe, so make packet and queue into session
|
||||||
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user