Core/InstanceScript: Function DoRemoveAurasDoToSpellOnPlayers() will also remove those auras from players' pets
This commit is contained in:
@@ -355,12 +355,19 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
|
|||||||
// Remove Auras due to Spell on all players in instance
|
// Remove Auras due to Spell on all players in instance
|
||||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||||
{
|
{
|
||||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||||
|
|
||||||
if (!PlayerList.isEmpty())
|
if (!PlayerList.isEmpty())
|
||||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
{
|
||||||
if (Player* pPlayer = i->getSource())
|
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||||
pPlayer->RemoveAurasDueToSpell(spell);
|
{
|
||||||
|
if (Player* player = itr->getSource())
|
||||||
|
{
|
||||||
|
player->RemoveAurasDueToSpell(spell);
|
||||||
|
if (Pet* pet = player->GetPet())
|
||||||
|
pet->RemoveAurasDueToSpell(spell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cast spell on all players in instance
|
// Cast spell on all players in instance
|
||||||
|
|||||||
Reference in New Issue
Block a user