mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Make battleground join / arena join / loot money session packet (#1178)
* Make battleground / arena join session packet * Loot money * Avoid aoe crash
This commit is contained in:
@@ -543,18 +543,22 @@ bool BGJoinAction::JoinQueue(uint32 type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
botAI->GetAiObjectContext()->GetValue<uint32>("bg type")->Set(0);
|
botAI->GetAiObjectContext()->GetValue<uint32>("bg type")->Set(0);
|
||||||
|
|
||||||
if (!isArena)
|
if (!isArena)
|
||||||
{
|
{
|
||||||
WorldPacket packet(CMSG_BATTLEMASTER_JOIN, 20);
|
WorldPacket* packet = new WorldPacket(CMSG_BATTLEMASTER_JOIN, 20);
|
||||||
packet << bot->GetGUID() << bgTypeId_ << instanceId << joinAsGroup;
|
*packet << bot->GetGUID() << bgTypeId_ << instanceId << joinAsGroup;
|
||||||
bot->GetSession()->HandleBattlemasterJoinOpcode(packet);
|
/// FIX race condition
|
||||||
|
// bot->GetSession()->HandleBattlemasterJoinOpcode(packet);
|
||||||
|
bot->GetSession()->QueuePacket(packet);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WorldPacket arena_packet(CMSG_BATTLEMASTER_JOIN_ARENA, 20);
|
WorldPacket* arena_packet = new WorldPacket(CMSG_BATTLEMASTER_JOIN_ARENA, 20);
|
||||||
arena_packet << unit->GetGUID() << arenaslot << asGroup << uint8(isRated);
|
*arena_packet << unit->GetGUID() << arenaslot << asGroup << uint8(isRated);
|
||||||
bot->GetSession()->HandleBattlemasterJoinArena(arena_packet);
|
/// FIX race condition
|
||||||
|
// bot->GetSession()->HandleBattlemasterJoinArena(arena_packet);
|
||||||
|
bot->GetSession()->QueuePacket(arena_packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -356,8 +356,9 @@ bool StoreLootAction::Execute(Event event)
|
|||||||
|
|
||||||
if (gold > 0)
|
if (gold > 0)
|
||||||
{
|
{
|
||||||
WorldPacket packet(CMSG_LOOT_MONEY, 0);
|
WorldPacket* packet = new WorldPacket(CMSG_LOOT_MONEY, 0);
|
||||||
bot->GetSession()->HandleLootMoneyOpcode(packet);
|
bot->GetSession()->QueuePacket(packet);
|
||||||
|
// bot->GetSession()->HandleLootMoneyOpcode(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8 i = 0; i < items; ++i)
|
for (uint8 i = 0; i < items; ++i)
|
||||||
|
|||||||
@@ -135,7 +135,11 @@ Aura* AreaDebuffValue::Calculate()
|
|||||||
for (auto i = list.begin(); i != list.end(); ++i)
|
for (auto i = list.begin(); i != list.end(); ++i)
|
||||||
{
|
{
|
||||||
AuraEffect* aurEff = *i;
|
AuraEffect* aurEff = *i;
|
||||||
|
if (!aurEff)
|
||||||
|
continue;
|
||||||
Aura* aura = aurEff->GetBase();
|
Aura* aura = aurEff->GetBase();
|
||||||
|
if (!aura)
|
||||||
|
continue;
|
||||||
AuraObjectType type = aura->GetType();
|
AuraObjectType type = aura->GetType();
|
||||||
bool isPositive = aura->GetSpellInfo()->IsPositive();
|
bool isPositive = aura->GetSpellInfo()->IsPositive();
|
||||||
if (type == DYNOBJ_AURA_TYPE && !isPositive)
|
if (type == DYNOBJ_AURA_TYPE && !isPositive)
|
||||||
|
|||||||
Reference in New Issue
Block a user