mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
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
|
||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* pPlayer = i->getSource())
|
||||
pPlayer->RemoveAurasDueToSpell(spell);
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||
{
|
||||
if (Player* player = itr->getSource())
|
||||
{
|
||||
player->RemoveAurasDueToSpell(spell);
|
||||
if (Pet* pet = player->GetPet())
|
||||
pet->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cast spell on all players in instance
|
||||
|
||||
Reference in New Issue
Block a user