mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +00:00
Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -153,6 +153,22 @@ bool SummonList::IsAnyCreatureAlive() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SummonList::IsAnyCreatureWithEntryAlive(uint32 entry) const
|
||||
{
|
||||
for (auto const& guid : storage_)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
if (summon->GetEntry() == entry && summon->IsAlive())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SummonList::IsAnyCreatureInCombat() const
|
||||
{
|
||||
for (auto const& guid : storage_)
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
void DespawnEntry(uint32 entry);
|
||||
void DespawnAll();
|
||||
bool IsAnyCreatureAlive() const;
|
||||
bool IsAnyCreatureWithEntryAlive(uint32 entry) const;
|
||||
bool IsAnyCreatureInCombat() const;
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -1986,6 +1986,11 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
// don't let Death Knights join BG queues when they are not allowed to be teleported yet
|
||||
if (member->getClass() == CLASS_DEATH_KNIGHT && member->GetMapId() == 609 && !member->IsGameMaster() && !member->HasSpell(50977))
|
||||
return ERR_GROUP_JOIN_BATTLEGROUND_FAIL;
|
||||
|
||||
if (!member->GetBGAccessByLevel(bgTemplate->GetBgTypeID()))
|
||||
{
|
||||
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;
|
||||
}
|
||||
}
|
||||
|
||||
// for arenas: check party size is proper
|
||||
|
||||
@@ -187,6 +187,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
err = ERR_BATTLEGROUND_NONE;
|
||||
}
|
||||
else if (!_player->GetBGAccessByLevel(bgTypeId))
|
||||
{
|
||||
err = ERR_BATTLEGROUND_NONE;
|
||||
}
|
||||
|
||||
if (err <= 0)
|
||||
{
|
||||
@@ -236,6 +240,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
err = ERR_BATTLEGROUND_NONE;
|
||||
}
|
||||
else if (!member->GetBGAccessByLevel(bgTypeId))
|
||||
{
|
||||
err = ERR_BATTLEGROUND_JOIN_TIMED_OUT;
|
||||
}
|
||||
|
||||
if (err < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user